@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  --bg: #1b1442;
  --bg-2: #2a1f63;
  --card: #ffffff;
  --ink: #1d1838;
  --ink-soft: #5d5880;
  --text-on-dark: #ffffff;
  --muted-on-dark: #c9c3ef;
  --blue: #1f7bff;
  --blue-dark: #0b4fc2;
  --blue-glow: rgba(31, 123, 255, .55);
  --red: #ff3b4e;
  --red-dark: #c4142a;
  --red-glow: rgba(255, 59, 78, .55);
  --green: #1fcf6b;
  --green-dark: #0f9a4b;
  --yellow: #ffc83d;
  --yellow-dark: #e09a00;
  --purple: #8b5cf6;
  --gray: #8a86a8;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--text-on-dark);
  background:
    radial-gradient(circle at 15% 10%, rgba(139, 92, 246, .35), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(255, 200, 61, .18), transparent 45%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* Botão "gordinho" estilo jogo */
.btn {
  --c: var(--purple);
  --c-dark: #6233d9;
  border: 0;
  border-radius: 16px;
  padding: .7em 1.4em;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--c);
  box-shadow: 0 6px 0 var(--c-dark), 0 10px 20px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  user-select: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--c-dark), 0 4px 10px rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.blue { --c: var(--blue); --c-dark: var(--blue-dark); }
.btn.red { --c: var(--red); --c-dark: var(--red-dark); }
.btn.green { --c: var(--green); --c-dark: var(--green-dark); }
.btn.yellow { --c: var(--yellow); --c-dark: var(--yellow-dark); color: var(--ink); }
.btn.gray { --c: #5f5a85; --c-dark: #403b66; }
.btn.ghost {
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
  border: 2px solid rgba(255, 255, 255, .2);
}
.btn.ghost:active { transform: translateY(2px); box-shadow: none; }
.btn.big { font-size: 1.6rem; padding: .6em 1.5em; border-radius: 20px; }
.btn.small { font-size: .95rem; padding: .45em .9em; border-radius: 12px; }
.btn kbd {
  font-family: inherit;
  font-size: .65em;
  background: rgba(0, 0, 0, .2);
  padding: .1em .45em;
  border-radius: 6px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 30, .7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
  animation: fade-in .2s;
}
.modal {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-shadow: var(--shadow);
  animation: pop-in .3s cubic-bezier(.2, 1.6, .4, 1);
}
.modal h2 { margin: 0 0 16px; font-size: 1.7rem; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } }

/* Aviso rápido (toast) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: toast-in .3s cubic-bezier(.2, 1.6, .4, 1);
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.error { background: var(--red); color: #fff; }
@keyframes toast-in { from { transform: translate(-50%, 40px); opacity: 0; } }

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}
