/* =========================================================
   팩토리 마블 — 입장·대기실 화면 (게임 화면과 같은 머스터드·먹선·크림 카드)
   ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--stage);
  background-image: radial-gradient(var(--stage-deep) 18%, transparent 21%);
  background-size: 14px 14px;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input, select { font: inherit; color: inherit; }
.num, .num * { font-variant-numeric: tabular-nums; }
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
[hidden] { display: none !important; }

/* 공통 카드·버튼 */
.card-box {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-l);
  box-shadow: 0 5px 0 var(--ink);
}
.b {
  font-family: var(--font-display);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  background: #fff;
  padding: .45em 1.1em .38em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  white-space: nowrap;
  transition: transform .08s, box-shadow .08s;
}
.b:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.b:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }
.b-go { background: #5ed184; }
.b-go:hover:not(:disabled) { background: #74dc95; }
.b-gold { background: var(--gold); }
.b-sm { font-size: 14px; padding: .32em .9em .26em; box-shadow: 0 3px 0 var(--ink); }
.b-lg { font-size: 22px; padding: .5em 1.4em .42em; }
:focus-visible { outline: 3px solid #3f86dc; outline-offset: 2px; }

.field {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding: .5em .8em;
  min-width: 0;
}

/* 알림 */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 15px;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(43, 33, 24, .3);
  animation: tIn .25s ease-out;
  max-width: min(92vw, 520px); text-align: center;
}
.toast.err { background: var(--warn); }
.toast.ok { background: var(--go-deep); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .4s; }
@keyframes tIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 입장 화면 ---------- */
.enter {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px 16px;
}
.en-box {
  width: min(460px, 100%);
  padding: 30px 28px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  position: relative;
}
.en-chars { display: flex; justify-content: center; gap: 6px; margin-top: -78px; }
.en-chars img { height: 92px; filter: drop-shadow(0 3px 0 rgba(43, 33, 24, .25)); animation: bob 2.4s ease-in-out infinite; }
.en-chars img:nth-child(2) { animation-delay: .3s; height: 104px; }
.en-chars img:nth-child(3) { animation-delay: .6s; height: 78px; }
.en-chars img:nth-child(4) { animation-delay: .9s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.logo {
  font-family: var(--font-display);
  font-size: 46px; line-height: 1;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
  letter-spacing: .02em;
  background: var(--ink);
  padding: 10px 22px 12px;
  border-radius: 16px;
}
.logo-tag { font-family: var(--font-display); font-size: 16px; background: var(--gold); border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px 14px 2px; margin-top: -26px; position: relative; }
.en-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.en-form label { font-weight: 800; font-size: 15px; text-align: center; }
.en-code {
  font-family: var(--font-display);
  font-size: 34px; letter-spacing: .32em; text-align: center; text-transform: uppercase;
  padding: .25em .3em .2em .62em;
}
.en-form .b { font-size: 22px; }
.en-err { min-height: 1.3em; color: var(--warn); font-weight: 800; text-align: center; font-size: 14px; }
.en-foot { display: flex; gap: 14px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.en-foot a { color: var(--ink-2); }

@media (max-width: 420px) {
  .logo { font-size: 36px; }
  .en-code { font-size: 28px; }
  .en-chars img { height: 72px; }
  .en-chars img:nth-child(2) { height: 82px; }
  .en-chars img:nth-child(3) { height: 62px; }
}
