/* Flingisenflong Games – shared glossy toy-plastic UI kit (site + every game). */

:root {
  --ink: #3b2a20;
  --ink-soft: #7a6555;
  --card: rgba(255, 255, 255, 0.94);
  --line: #f0e4d8;
  --orange: #ff9f1c;
  --orange-dark: #d9740a;
  --green: #3ccf6e;
  --green-dark: #23a052;
  --blue: #4cc3ff;
  --blue-dark: #1f95d6;
  --pink: #ff5fa2;
  --gold: #ffcf33;
  --gold-dark: #e0a10f;
  --red: #ff4d5e;
  --font: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.center { text-align: center; }
p { margin: 0; }

/* ------------------------------------------------------------ cards */

.panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.08), 0 20px 50px rgba(30, 40, 90, 0.25), inset 0 2px 0 #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel.narrow { width: min(400px, 100%); }
.panel.wide { width: min(660px, 100%); }
.panel.side { margin-left: auto; }
.panel.pop { animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }

h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { text-align: left; }

/* ------------------------------------------------------------ candy buttons */

.btn-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.btn {
  --c: #ffffff;
  --c-dark: #d8cfc6;
  --c-text: var(--ink);
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 21px;
  font-weight: 600;
  color: var(--c-text);
  background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%), var(--c);
  border: none;
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--c-dark), 0 10px 18px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
/* glossy highlight blob */
.btn::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; top: 5px;
  height: 34%;
  border-radius: 12px 12px 30px 30px;
  background: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.06) saturate(1.1); outline: none; }
.btn:focus-visible { box-shadow: 0 6px 0 var(--c-dark), 0 0 0 4px rgba(76, 195, 255, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.7); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--c-dark), 0 3px 6px rgba(0, 0, 0, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.7); }
.btn.primary { --c: var(--orange); --c-dark: var(--orange-dark); --c-text: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn.green { --c: var(--green); --c-dark: var(--green-dark); --c-text: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.btn.ghost { --c: #f4ede6; --c-dark: #d8cbbd; }
.btn.big { min-height: 62px; font-size: 28px; }
.btn.small { min-height: 36px; font-size: 16px; border-radius: 12px; padding: 4px 10px; box-shadow: 0 4px 0 var(--c-dark), inset 0 2px 0 rgba(255, 255, 255, 0.7); }
.btn.small::after { top: 3px; left: 8px; right: 8px; }
.btn.small:active { transform: translateY(3px); }
.btn:disabled {
  --c: #e6e1dc; --c-dark: #cfc8c1; --c-text: #a69b91;
  cursor: not-allowed; filter: none; text-shadow: none; transform: none;
}

.icon-btn {
  width: 48px; height: 48px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%), #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 0 #d8cfc6, 0 8px 14px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8cfc6; }

/* ------------------------------------------------------------ link back to the site */

.home-link {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%), #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 #d8cfc6, 0 8px 14px rgba(0, 0, 0, 0.15);
}
.home-link:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8cfc6; }
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .home-link { height: 42px; padding: 0 14px; font-size: 14px; }
}

/* ------------------------------------------------------------ forms */

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink-soft); font-size: 15px; }
input {
  font-family: var(--font);
  font-size: 19px;
  padding: 10px 14px;
  color: var(--ink);
  background: #f8f3ee;
  border: 3px solid #eadfd4;
  border-radius: 14px;
  outline: none;
  user-select: text;
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.04);
}
input:focus { border-color: var(--blue); background: #fff; }
form { display: flex; flex-direction: column; gap: 12px; }
.error { color: var(--red); min-height: 1.2em; font-weight: 500; }

.tabs { display: flex; gap: 4px; padding: 4px; background: #f1e9e1; border-radius: 16px; }
.tab {
  flex: 1;
  padding: 8px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 3px 0 #e2d6ca; }

/* ------------------------------------------------------------ pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%), #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------------ toasts */

#toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  padding: 8px 18px 8px 10px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.1), 0 12px 24px rgba(0, 0, 0, 0.15);
  animation: toast-in 0.35s cubic-bezier(0.2, 1.5, 0.4, 1), fade-out 0.5s ease-in 3.5s forwards;
}
.toast .portrait { width: 48px; height: 48px; }
.toast .t-title { color: var(--orange-dark); font-size: 16px; font-weight: 700; }
.toast .t-body { font-size: 16px; font-weight: 500; }
.toast.error .t-title { color: var(--red); }

@keyframes toast-in { from { transform: translateX(120%); } to { transform: none; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
