/* Liaison de mots — thème années 2000 (aligné sur minigames/style-2000s.css) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

@keyframes y2k-twinkle {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.75;
  }
}

.y2k-wordle {
  color: #000;
  font-family: 'Comic Sans MS', 'Arial', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  min-height: 100dvh;
  background: #c0c0c0
    url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0z' fill='%23d0d0d0'/%3E%3Cpath d='M0 0h1v20H0z' fill='%23e8e8e8'/%3E%3Cpath d='M0 0h20v1H0z' fill='%23e8e8e8'/%3E%3C/svg%3E")
    repeat;
  padding: 8px;
  position: relative;
}

.y2k-wordle::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(255, 200, 255, 0.5), transparent),
    radial-gradient(2px 2px at 40% 80%, rgba(200, 255, 255, 0.5), transparent);
  animation: y2k-twinkle 4s ease-in-out infinite;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 0 auto;
  min-height: calc(100dvh - 16px);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #ececec 0%, #c0c0c0 100%);
  border: 3px solid #fff;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.35), inset 1px 1px 0 #fff;
}

.screen {
  animation: fade 0.2s ease;
}

/* L’attribut HTML hidden doit rester prioritaire (sinon d’autres règles display:* l’écrasent). */
.app .screen[hidden] {
  display: none !important;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.topbar {
  background: linear-gradient(180deg, #4169e1 0%, #1e90ff 55%, #0000cd 100%);
  border: 2px outset #87ceeb;
  padding: 12px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.logo {
  margin: 0;
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  color: #fff;
  text-shadow: 2px 2px 0 #000080, -1px -1px 0 #000;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tagline {
  margin: 6px 0 0;
  font-size: 11px;
  color: #e0ffff;
  text-shadow: 1px 1px 0 #000080;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary {
  width: 100%;
  padding: 10px 14px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  border-radius: 2px;
  background: linear-gradient(180deg, #d8d8d8 0%, #a8a8a8 100%);
  color: #000;
  font: inherit;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-primary:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  padding: 11px 13px 9px 15px;
}

.btn-secondary {
  width: 100%;
  padding: 8px 12px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #606060;
  border-right: 2px solid #606060;
  border-radius: 2px;
  background: linear-gradient(180deg, #e4e4e4 0%, #c0c0c0 100%);
  color: #000080;
  font: inherit;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-secondary:active {
  border-top: 2px solid #606060;
  border-left: 2px solid #606060;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

.subheader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.subheader h2 {
  margin: 0;
  flex: 1;
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: 14px;
  text-align: center;
  color: #000080;
  text-shadow: 1px 1px 0 #fff;
}

.btn-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  background: linear-gradient(180deg, #e0e0e0 0%, #b0b0b0 100%);
  color: #000080;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.category-list,
.level-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
  color: #000;
  font: inherit;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.cat-icon {
  font-size: 1.4rem;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%);
  color: #000080;
  font: inherit;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
}

.level-row.locked {
  background: linear-gradient(180deg, #d0d0d0 0%, #a8a8a8 100%);
  color: #555;
  cursor: not-allowed;
}

/* Niveau déjà réussi (distinct du simple « débloqué ») */
.level-row.done {
  background: linear-gradient(180deg, #e8fff0 0%, #c8f0d8 100%);
  border-color: #2e8b57;
  color: #0d3d26;
}

.level-row.done .level-status {
  color: #228b22;
  font-weight: bold;
}

.level-icon {
  font-size: 1.1rem;
}

.padlock {
  margin-left: auto;
  opacity: 0.85;
}

.level-status {
  margin-left: auto;
  font-size: 11px;
  white-space: nowrap;
}

.game-head {
  align-items: flex-start;
}

.game-head-text {
  flex: 1;
  text-align: center;
}

.game-head-text h2 {
  margin: 0;
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: 13px;
  color: #000080;
}

.game-sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: #333;
}

.target-wrap {
  text-align: center;
  margin-bottom: 10px;
  padding: 6px;
  background: #ffffcc;
  border: 2px inset #ccc;
}

.target-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #800080;
  font-weight: bold;
}

.target-word {
  margin: 4px 0 0;
  font-family: Impact, 'Arial Black', sans-serif;
  font-size: clamp(0.85rem, 4vw, 1.15rem);
  color: #000;
  word-break: break-all;
  letter-spacing: 0.04em;
}

.grid-wrap {
  margin: 0 auto 10px;
  max-width: 100%;
  overflow: visible;
}

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-template-rows: repeat(var(--rows), var(--cell));
  gap: 8px;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  --cell: min(16vw, 2.85rem);
}

.grid-compact {
  --cell: min(12vw, 2.2rem);
}

.grid-tiny {
  --cell: min(9vw, 1.65rem);
}

.path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.grid-cell {
  position: relative;
  z-index: 1;
  width: var(--cell);
  height: var(--cell);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  border-radius: 50%;
  /* Lisibilité : police système lisible, pas Impact (trop compact) */
  background: radial-gradient(circle at 35% 28%, #ffffff 0%, #eef4fc 50%, #c5d8ee 100%);
  color: #000000;
  font: inherit;
  font-family: 'Segoe UI', 'Segoe UI Variable', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(0.92rem, 5.2vw, 1.2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-cell.on-path {
  background: radial-gradient(circle at 35% 28%, #fffef5 0%, #ffd6e5 55%, #e85d8e 100%);
  color: #1a0a12;
  text-shadow: none;
}

.grid-cell.locked {
  background: radial-gradient(circle at 35% 28%, #f0fff4 0%, #7fd67f 50%, #1e7a1e 100%);
  color: #042108;
  text-shadow: none;
  opacity: 1;
  cursor: default;
}

.progress {
  min-height: 1.5rem;
  margin-bottom: 6px;
}

.progress-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-bottom: 3px;
}

.progress-sq {
  width: 9px;
  height: 9px;
  border: 1px solid #404040;
  background: #a0a0a0;
}

.progress-sq.current {
  background: linear-gradient(180deg, #ffff99 0%, #ff9900 100%);
  border-color: #000;
}

.progress-sq.done {
  background: linear-gradient(180deg, #99ff99 0%, #00aa00 100%);
}

.message {
  text-align: center;
  min-height: 1.3em;
  font-size: 12px;
  font-weight: bold;
  margin: 0 0 8px;
}

.message[data-kind='warn'] {
  color: #cc0000;
}

.message[data-kind='ok'] {
  color: #006400;
}

.message[data-kind='hint'] {
  color: #000080;
  font-weight: normal;
  font-size: 11px;
}

.game-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding-top: 4px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  background: linear-gradient(180deg, #e8e8e8 0%, #b0b0b0 100%);
  color: #000080;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-hint {
  flex: 1;
  max-width: 14rem;
  padding: 10px 12px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #404040;
  border-right: 2px solid #404040;
  background: linear-gradient(180deg, #ffffff 0%, #d0d0d0 100%);
  color: #000;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
}

.account-intro {
  font-size: 11px;
  margin: 0 0 10px;
  color: #333;
  line-height: 1.4;
}

.account-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: 2px outset #fff;
  background: #d0d0d0;
  font: inherit;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  color: #000080;
}

.tab-btn.tab-active {
  background: linear-gradient(180deg, #fff 0%, #c8c8c8 100%);
  border-style: inset;
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Sinon .account-panel { display:flex } annule l’attribut [hidden] sur les panneaux / #accountUser. */
#screenAccount [hidden] {
  display: none !important;
}

.field-label {
  font-size: 11px;
  font-weight: bold;
  color: #000080;
}

.field-input {
  width: 100%;
  padding: 8px 10px;
  border: 2px inset #ccc;
  background: #fff;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.account-status {
  margin: 0 0 8px;
  font-size: 13px;
}

.account-msg {
  margin-top: 10px;
  min-height: 1.2em;
}

#accountUser .btn-primary,
#accountUser .btn-secondary {
  margin-top: 4px;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Intégration coquille mini-jeux (#wrapper + style-2000s) — ne pas retirer le fond à carreaux du body */
body.y2k-wordle.minigames-site {
  min-height: 0;
}

#wrapper .frame .app {
  min-height: auto;
}
