/* Seal ERA CP: shared look. Wood and parchment from the game's lobby (sera-5/assets/lobby), circus from its login. */
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --parch: #fbeec9;
  --parch-deep: #f1dca6;
  --ink: #3b2510;
  --ink-soft: #7a5a38;
  --ink-faint: #a48f74;
  --shadow: #2a1406;
  --gold: #e8b23c;
  --gold-hi: #f4ca67;
  --wood: #6a3208;
  --wood-hi: #9a5a22;
  --red: #c8352a;
  --red-hi: #e8352a;
  --green: #2f7d32;
  --green-hi: #3f9a46;
  --warn: #b2401c;
  --sky: #2aa3ee;
  --cream: #fffdf2;
  --display: "Fredoka", "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --body: "Fredoka", "Segoe UI", "Noto Sans", system-ui, sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: #1b6fb8;
  cursor: url("../img/cursor.png") 2 2, auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a, button, label, select, .clickable { cursor: url("../img/cursor.png") 2 2, pointer; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; }
a { color: var(--wood); font-weight: 600; }
a:hover { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- wooden buttons (lobby/dialog_button*.png, 9-slice margin 12) --------------------------------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 6px 26px;
  border: 14px solid transparent; border-image: url("../img/btn.png") 14 fill / 14px stretch;
  background: none; color: #fff7dc;
  font: 600 18px/1 var(--display); letter-spacing: .3px;
  text-shadow: 0 2px 0 var(--shadow), 0 0 6px rgba(42, 20, 6, .5);
  text-decoration: none; user-select: none;
  transition: transform .18s var(--ease-pop), filter .2s;
  filter: drop-shadow(0 4px 0 rgba(42, 20, 6, .35));
}
.btn:hover { border-image-source: url("../img/btn-hover.png"); transform: translateY(-2px) scale(1.03); color: #fffbe8; filter: drop-shadow(0 6px 4px rgba(42, 20, 6, .4)) brightness(1.06); }
.btn:active { border-image-source: url("../img/btn-down.png"); transform: translateY(2px) scale(.98); color: #e8d3a0; filter: none; }
.btn:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.btn[disabled], .btn.is-off { border-image-source: url("../img/btn-off.png"); color: #d9c9a8; transform: none; filter: grayscale(.4); cursor: not-allowed; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid rgba(255, 247, 220, .35); border-top-color: #fff7dc; animation: spin .7s linear infinite;
}
.btn-gold {
  --h: 58px; border: 0; border-image: none; padding: 0 40px; min-height: 58px; min-width: 220px;
  background: url("../img/btn-enter.png") center / 100% 100% no-repeat;
  color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .6); font-size: 21px; font-weight: 700;
}
.btn-gold:hover { background-image: url("../img/btn-enter-hover.png"); border-image: none; color: var(--shadow); filter: drop-shadow(0 0 14px rgba(255, 210, 90, .85)); }
.btn-gold:active { border-image: none; color: var(--shadow); }
.btn-gold.is-busy::after { border-color: rgba(59, 37, 16, .3); border-top-color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--wood); font: 600 15px var(--body); padding: 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ---- fields (lobby/dialog_field.png) ---------------------------------------------------------- */
.field { display: grid; gap: 6px; text-align: left; }
.field > span { font: 600 14px var(--display); color: var(--ink-soft); letter-spacing: .4px; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 50px; padding: 0 16px; font: 500 17px var(--body); color: var(--ink);
  border: 16px solid transparent; border-image: url("../img/field.png") 24 fill / 16px stretch;
  padding-inline: 4px; background: none; outline: none;
  transition: filter .2s, transform .2s;
}
.input::placeholder { color: #a99674; }
.input:focus { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px rgba(244, 202, 103, .95)); }
.input.is-bad { animation: shake .4s; filter: drop-shadow(0 0 5px rgba(200, 53, 42, .8)); }
.input-wrap .peek {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; padding: 6px; color: var(--ink-soft); font-size: 18px; line-height: 1;
}
.hint { font-size: 13px; color: var(--ink-faint); }

/* ---- messages ----------------------------------------------------------------------------------- */
.note {
  border-radius: 14px; padding: 10px 14px; font-size: 15px; line-height: 1.4; text-align: left;
  background: rgba(255, 255, 255, .55); border: 2px dashed rgba(122, 90, 56, .45);
  animation: pop .35s var(--ease-pop);
}
.note.bad { background: #ffe3dc; border: 2px solid #e58b74; color: #7c2412; }
.note.ok { background: #e3f6d9; border: 2px solid #8cc77a; color: #22561f; }
.note.info { background: #e6f3fb; border: 2px solid #8cc0e0; color: #1d4c6b; }

.toast-stack { position: fixed; z-index: 90; top: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 18px;
  border: 18px solid transparent; border-image: url("../img/popup.png") 26 fill / 18px stretch;
  padding: 0 4px; min-height: 40px; font-weight: 600; color: var(--ink);
  animation: toast-in .5s var(--ease-pop); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35));
}
.toast.out { animation: toast-out .35s ease-in forwards; }
.toast .ico { font-size: 22px; }

/* ---- Turnstile ---------------------------------------------------------------------------------- */
.captcha { min-height: 65px; display: flex; justify-content: center; }
.captcha.is-loading::before { content: "Memuat verifikasi…"; font-size: 13px; color: var(--ink-faint); align-self: center; }

/* ---- shared keyframes --------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes toast-in { from { transform: translateY(-40px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-30px) scale(.9); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* confetti / sparkle layer (common.js) */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.fx-bit { position: absolute; top: 0; left: 0; will-change: transform, opacity; }
.mote { border-radius: 50%; background: radial-gradient(circle, rgba(255, 246, 210, .95), rgba(255, 205, 100, .45) 38%, transparent 70%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fx-layer { display: none; }
}
