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

:root {
  --bg-void: #140B26;
  --bg-void-2: #1B1033;
  --grape: #6B3FA0;
  --jungle: #2F9E6E;
  --ice: #3FA9F5;
  --watermelon: #E8425B;
  --cream: #F4EEFF;
  --cream-dim: #C6B9E8;
  --radius-blob: 42% 58% 61% 39% / 45% 41% 59% 55%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 20% -10%, #2a1750 0%, var(--bg-void) 55%);
  color: var(--cream);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ice); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* --- Logo COCO64, chaque lettre une couleur, façon logo N64 --- */
.logo {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  letter-spacing: 0.02em;
  display: inline-flex;
  gap: 0.02em;
  line-height: 1;
  margin: 0;
}
.logo span { display: inline-block; transform: translateY(0); }
.logo .c1 { color: var(--watermelon); }
.logo .c2 { color: var(--ice); }
.logo .c3 { color: var(--jungle); }
.logo .c4 { color: var(--grape); }
.logo .c5 { color: #F5C242; }
.logo .c6 { color: var(--ice); }

.tagline {
  color: var(--cream-dim);
  font-size: 0.95rem;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

nav.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}
nav.top-actions button.ghost {
  background: transparent;
  border: 1px solid rgba(244,238,255,0.25);
  color: var(--cream);
}

/* --- Carte / panneau --- */
.card {
  background: rgba(244, 238, 255, 0.05);
  border: 1px solid rgba(244, 238, 255, 0.1);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(6px);
}

/* --- Le "signature element" : la coque translucide façon N64 Funtastic --- */
.shell {
  position: relative;
  border-radius: var(--radius-blob);
  padding: 46px 32px;
  background:
    linear-gradient(135deg, rgba(107,63,160,0.35), rgba(47,158,110,0.28) 45%, rgba(63,169,245,0.25));
  border: 1px solid rgba(244,238,255,0.18);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15) inset, 0 20px 60px rgba(60,20,110,0.35);
  text-align: center;
  transition: transform 0.35s ease, border-radius 0.6s ease;
}
.shell:hover {
  transform: translateY(-2px) scale(1.005);
  border-radius: 46% 54% 55% 45% / 41% 47% 53% 59%;
}
.shell.dragover {
  border-color: var(--jungle);
  background:
    linear-gradient(135deg, rgba(47,158,110,0.4), rgba(63,169,245,0.3));
}

/* --- Formulaires --- */
label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"] {
  width: 100%;
  background: rgba(20, 11, 38, 0.6);
  border: 1px solid rgba(244,238,255,0.2);
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
input:focus {
  outline: 2px solid var(--ice);
  outline-offset: 1px;
}

button {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: var(--bg-void);
  background: var(--cream);
  transition: transform 0.15s ease, filter 0.15s ease;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 3px solid var(--ice); outline-offset: 2px; }

button.primary { background: var(--watermelon); color: var(--cream); }
button.secondary { background: var(--jungle); color: var(--cream); }
button.tertiary { background: var(--ice); color: var(--bg-void); }
button.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(244,238,255,0.3);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tabs button {
  flex: 1;
  background: rgba(244,238,255,0.06);
  color: var(--cream-dim);
}
.tabs button.active { background: var(--cream); color: var(--bg-void); }

.error-msg {
  color: var(--watermelon);
  font-size: 0.85rem;
  margin: -8px 0 14px;
  min-height: 1.2em;
}
.note {
  font-size: 0.82rem;
  color: var(--cream-dim);
  line-height: 1.6;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244,238,255,0.1);
  border: 1px solid rgba(244,238,255,0.2);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 760px) {
  .grid-two { grid-template-columns: 1.1fr 0.9fr; }
}

footer.site {
  margin-top: 60px;
  color: var(--cream-dim);
  font-size: 0.78rem;
  border-top: 1px solid rgba(244,238,255,0.1);
  padding-top: 18px;
  line-height: 1.7;
}

/* --- Page jeu --- */
#game-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(244,238,255,0.15);
}

.save-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .shell, button { transition: none; }
}
