@font-face {
  font-family: "Archivo Black";
  src: url("/fonts/archivo-black-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #120d1f;
  --panel: #1d1530;
  --text: #f4eefc;
  --muted: #b9add0;
  --accent: #ff4fa3;
  --accent-2: #2fd4c8;
  --correct: #1f9d55;
  --partial: #c9a227;
  --wrong: #b3263a;
  --radius: 10px;
  --title-font: "Archivo Black", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #2a1748 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}
body:not(.twitch-page) {
  --muted: #c7badc;
  background: var(--bg);
  isolation: isolate;
}
body:not(.twitch-page)::before {
  --horizon: 71dvh;
  --sun-position: 68%;
  --sun-size: min(clamp(12rem, 29vw, 24rem), 65dvh);
  --palm-size: clamp(9rem, 24vw, 22rem);
  --sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E\
%3Cdefs%3E%3ClinearGradient id='sun' x2='0' y2='1'%3E%3Cstop stop-color='%23ffba84'/%3E%3Cstop offset='0.58' stop-color='%23f78a73'/%3E%3Cstop offset='1' stop-color='%23d64e81'/%3E%3C/linearGradient%3E\
%3CclipPath id='edge'%3E%3Ccircle cx='100' cy='100' r='100'/%3E%3C/clipPath%3E%3C/defs%3E\
%3Ccircle cx='100' cy='100' r='100' fill='url(%23sun)'/%3E\
%3Cpath d='M0 54H200V57H0ZM0 65H200V69H0ZM0 77H200V82H0ZM0 90H200V96H0Z' fill='%237b345a' clip-path='url(%23edge)'/%3E%3C/svg%3E");
  --palms-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 245'%3E\
%3Cdefs%3E%3Cpath id='palm' d='M68 246C69 188 79 122 104 79C86 101 66 155 58 246ZM104 79C78 42 45 45 17 67C48 57 71 58 91 73C48 56 21 79 3 109C32 88 58 78 88 81C57 91 43 115 41 145C52 123 70 103 101 88C88 111 93 137 106 155C104 126 107 105 112 89C125 101 136 123 139 144C146 122 135 96 119 84C147 82 166 96 185 116C175 82 153 68 119 76C146 53 174 56 200 68C180 41 143 37 114 67C116 45 128 28 147 17C120 20 101 40 104 79Z'/%3E%3C/defs%3E\
%3Cuse href='%23palm' fill='%23150e20' transform='translate(151 108) scale(-.51 .56)'/%3E\
%3Cuse href='%23palm' fill='%230f0a18' transform='translate(14 0)'/%3E%3C/svg%3E");
  --palms-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 245'%3E\
%3Cdefs%3E%3Cpath id='palm' d='M168 246C166 188 151 121 128 68C151 103 172 157 180 246ZM128 68C97 34 64 47 43 73C68 57 95 54 115 69C71 63 46 86 35 120C57 96 82 82 115 77C91 91 84 118 88 143C96 115 108 94 128 81C127 103 139 129 157 144C148 119 143 96 138 80C170 86 193 104 211 130C202 93 171 70 142 73C175 59 206 67 230 87C214 54 174 44 137 66C151 39 173 33 201 34C170 15 139 33 128 60C121 37 100 22 74 25C99 32 118 47 128 68Z'/%3E%3C/defs%3E\
%3Cuse href='%23palm' fill='%23150e20' transform='translate(32 103) scale(.54 .58)'/%3E\
%3Cuse href='%23palm' fill='%230f0a18' transform='translate(16 0)'/%3E%3C/svg%3E");
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Palmiers, voile de contraste, premier plan, soleil puis ciel. */
  background:
    var(--palms-left) left bottom / var(--palm-size) auto no-repeat,
    var(--palms-right) right bottom / var(--palm-size) auto no-repeat,
    linear-gradient(#11091d47, #11091dab 36%, #11091dab var(--horizon), #11091d44),
    linear-gradient(transparent var(--horizon), #51294b var(--horizon), #332140 calc(var(--horizon) + 9dvh), #30223c),
    var(--sun) left var(--sun-position) top calc(var(--horizon) - var(--sun-size) / 2) / var(--sun-size) no-repeat,
    linear-gradient(#221644, #58376e 36%, #f26092 61%, #f9a36a var(--horizon));
}
@media (width < 700px) {
  body:not(.twitch-page)::before {
    --horizon: 75dvh;
    --sun-position: 50%;
    --palm-size: clamp(2.25rem, 12vw, 4rem);
  }
}
a { color: var(--accent-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.masthead {
  padding: 8px 0 24px;
  background: linear-gradient(180deg, #1d1530e6, transparent);
}
.top { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.site-brand { min-width: 0; text-align: center; }
.site-tagline { margin: 4px 0 0; color: var(--muted); font-size: clamp(0.78rem, 2.8vw, 1rem); }
.top h1, .mode-title, .win h2, #mode-tabs button, .tab-link { font-family: var(--title-font); font-weight: 400; }
.top h1 { margin: 0; color: var(--text); font-size: clamp(1.35rem, 5vw, 2.5rem); line-height: 1.12; overflow-wrap: anywhere; }
.icon-btn { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--muted); background: var(--panel); color: var(--text); font-size: 1rem; cursor: pointer; }
#stats-btn { width: 44px; height: 44px; flex-shrink: 0; }
#stats-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 12px; }
.tabs button { border: 1px solid #3c2d5c; background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: 999px; cursor: pointer; font-size: 0.9rem; }
.tabs button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tabs button:disabled { opacity: 0.45; cursor: not-allowed; }
#mode-tabs button { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; }
#mode-tabs button:disabled { color: #d2cbd7; background: #322a38; opacity: 1; }
.mode-tab-badge { padding: 2px 5px; border-radius: 999px; background: #48304b; color: #ffe1ea; font: 700 0.65rem/1.2 system-ui, sans-serif; }
.mode-tab-short { display: none; }
@media (width >= 700px) {
  #mode-tabs button { flex-direction: column; justify-content: center; gap: 3px; font-family: system-ui, sans-serif; font-weight: 700; }
  .mode-tab-group-start { position: relative; margin-inline-start: 12px; }
  .mode-tab-group-start::before { content: ""; position: absolute; inset-inline-start: -11px; inset-block: 24%; width: 1px; background: #967d9f; }
}
@media (width < 700px) {
  .masthead { padding-bottom: 16px; }
  #mode-tabs {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 4px 28px 4px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }
  #mode-tabs::-webkit-scrollbar { display: none; }
  #mode-tabs button { flex: none; min-height: 44px; white-space: nowrap; scroll-snap-align: center; }
  .mode-tab-full { display: none; }
  .mode-tab-short { display: inline-flex; align-items: center; gap: 5px; }
}
.masthead :focus-visible, .mode-card:focus-visible, #mode-title:focus-visible { outline: 2px solid #fee27c; outline-offset: 2px; }
main { max-width: 900px; margin: 0 auto; padding: 12px; }
.intro { text-align: center; }
.intro .mode-title { margin: 8px 0; font-size: clamp(1.15rem, 4vw, 1.7rem); }
#mode-description { margin: 8px auto 12px; max-width: 56ch; }
.meta { color: var(--muted); font-size: 0.9rem; text-align: center; }
.puzzle-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 14px;
}
.puzzle-plate {
  display: grid;
  gap: 3px;
  position: relative;
  min-width: 132px;
  max-width: 100%;
  padding: 6px 17px;
  border: 2px solid #a96168;
  border-radius: 8px;
  background: #fce9da;
  color: #44223c;
  box-shadow: inset 0 0 0 2px #fff6ee;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.puzzle-plate::before, .puzzle-plate::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 5px;
  height: 3px;
  border-radius: 3px;
  background: #a96168;
}
.puzzle-plate::before { left: 5px; }
.puzzle-plate::after { right: 5px; }
.plate-number { font: 400 1.25rem/1.1 var(--title-font); letter-spacing: 0.04em; }
.play { display: flex; flex-direction: column; align-items: center; }
.guess-box { position: relative; width: min(100%, 420px); }
#guess-input { width: 100%; padding: 14px 16px; font-size: 1.05rem; border-radius: var(--radius); border: 2px solid #3c2d5c; background: var(--panel); color: var(--text); }
#guess-input::placeholder { color: var(--muted); opacity: 1; }
#guess-input:focus { outline: none; border-color: var(--accent); }
.suggestions { position: absolute; z-index: 5; left: 0; right: 0; margin-top: 4px; background: var(--panel); border: 1px solid #3c2d5c; border-radius: var(--radius); max-height: 50vh; overflow-y: auto; overscroll-behavior-y: contain; color-scheme: dark; }
.suggestions ul { margin: 0; padding: 0; list-style: none; }
.suggestions-count, .suggestions li { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; }
.suggestions-count { margin: 0; color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid #3c2d5c; }
.suggestions li { cursor: pointer; }
.suggestions li[aria-selected="true"] { background: #2c2045; box-shadow: inset 3px 0 var(--accent); }
@media (hover: hover) {
  .suggestions li[aria-selected="false"]:hover { background: #251b38; }
}
.win { position: relative; text-align: center; background: var(--panel); border: 1px solid var(--correct); border-radius: var(--radius); padding: 16px; margin: 16px auto; max-width: 720px; }
.win h2 { margin-top: 0; }
button.primary, a.primary { background: var(--accent); border: 0; color: #260f20; font-weight: 700; padding: 12px 18px; border-radius: var(--radius); cursor: pointer; font-size: 1rem; }
.confetti { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.confetti span {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 6px;
  height: 9px;
  border-radius: 2px;
  background: var(--confetti-color);
  animation: confetti-fall 1.35s ease-out both;
}
@keyframes confetti-fall {
  28% { transform: translate(var(--burst-x), -18px) rotate(110deg); }
  65% { opacity: 1; }
  100% { transform: translate(var(--fall-x), var(--fall-y)) rotate(var(--spin)); opacity: 0; }
}
#mode-cards { max-width: 42rem; margin: 16px auto; }
.mode-group + .mode-group { margin-top: 16px; }
.mode-group h3 { margin: 0 0 8px; font-size: 0.9rem; text-align: left; }
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mode-card {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
  height: 100%;
  min-height: 76px;
  padding: 8px;
  border: 1px solid #706185;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mode-card:hover:not(:disabled) { background: #302046; }
.mode-card[aria-current="true"] { border-color: var(--accent); }
.mode-card .mode-title { font-size: 0.81rem; line-height: 1.2; overflow-wrap: anywhere; }
.mode-icon { grid-row: span 2; text-align: center; font-size: 1.25rem; }
.mode-status { grid-column: 2; color: var(--muted); font-size: 0.75rem; }
.mode-card.done .mode-status { color: #81ecd2; }
.mode-card:disabled { background: #27232d; border-color: #635a6a; color: #d2cbd7; cursor: default; }
.mode-card:disabled .mode-icon { filter: grayscale(1); }
@media (min-width: 640px) { .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.board-wrap { overflow-x: auto; margin-top: 16px; }
.board { border-collapse: separate; border-spacing: 6px; margin: 0 auto; }
body:not(.twitch-page) .board { background: var(--panel); border-radius: var(--radius); }
.board th { font-size: 0.75rem; color: var(--muted); font-weight: 600; padding: 0 4px; text-align: center; min-width: 84px; }
.column-icon { display: block; margin-bottom: 3px; font-size: 1.1rem; line-height: 1.25; }
.board th:first-child, .board td:first-child { position: sticky; left: 0; z-index: 1; }
.board th:first-child { background: var(--panel); border-radius: 8px; }
.cell { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-width: 84px; min-height: 64px; padding: 6px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; }
.board td.cell { display: table-cell; vertical-align: middle; }
.cell.name { background: #2c2045; }
.cell.correct { background: var(--correct); color: #101b17; }
.cell.partial { background: var(--partial); color: #1b1404; }
.cell.wrong { background: var(--wrong); }
.board tr.new td { animation: flip 0.45s ease both; }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.map-view {
  display: grid;
  align-items: start;
  gap: 12px;
  max-width: 52rem;
  margin: 16px auto;
}
.map-sheet {
  position: relative;
  overflow: hidden;
  border: 1px solid #3e626d;
  border-radius: var(--radius);
  background: #132b38;
}
.place-map { display: block; width: 100%; height: auto; }
.map-grid { fill: none; stroke: #294552; stroke-width: 2; }
.map-labels { fill: #1b3032; font-size: 48px; font-weight: 750; text-anchor: middle; }
.map-lake-label { font-size: 36px; }
.map-compass { fill: #d6e8e8; font-size: 39px; font-weight: 700; text-anchor: middle; }
.map-far { --map-pin-color: #ff818a; }
.map-mid { --map-pin-color: #ffb36c; }
.map-near { --map-pin-color: #83e6a6; }
.map-found { --map-pin-color: #ffe27c; }
.map-pin use { fill: var(--map-pin-color); stroke: #12252e; stroke-width: 5; stroke-linejoin: round; }
.map-pin.map-found use { transform: scale(1.32); }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0;
  padding: 9px 10px;
  border-top: 1px solid #3e626d;
  list-style: none;
  font-size: 0.78rem;
}
.map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.map-legend li::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  border-radius: 50%;
  background: var(--map-pin-color);
}
.map-view .map-attempts { min-width: 0; margin: 0; }
.map-attempts .meta { text-align: left; }
#map-attempt-list {
  max-height: 14rem;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
#map-attempt-list:focus-visible { outline: 2px solid #fee27c; outline-offset: 2px; }
.map-attempt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #2c2045;
}
.map-attempt + .map-attempt { margin-top: 6px; }
.map-attempt-name { display: block; overflow-wrap: anywhere; }
.map-distance { color: var(--muted); font-size: 0.8rem; }
.map-reading { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.map-proximity { color: var(--map-pin-color); white-space: nowrap; }
@media (min-width: 760px) {
  .map-view { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  #map-attempt-list { max-height: 25rem; }
}

/* Espace réservé pour éviter les décalages de mise en page quand une publicité se charge. */
.ad-slot { min-height: 120px; margin: 160px auto 16px; max-width: 728px; }
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 32px 16px; }
.community-links, .backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.community-links a { text-decoration: none; }
.community-links a:hover { text-decoration: underline; }
.foot .community { margin-bottom: 24px; }
.foot .community h2 { color: var(--text); font-size: 1rem; }
.foot .community-links { justify-content: center; }
dialog { background: var(--panel); color: var(--text); border: 1px solid #3c2d5c; border-radius: var(--radius); max-width: 440px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
#stats-dialog { width: min(440px, calc(100% - 24px)); }
#stats-dialog h2 { margin: 0; }
#stats-mode { color: var(--muted); margin-top: 4px; }
.stats-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-totals div { background: var(--bg); border-radius: 8px; padding: 8px; }
.stats-totals dt { color: var(--muted); font-size: 0.9rem; }
.stats-totals dd { margin: 4px 0 0; font-weight: 700; }
.stats-histogram { list-style: none; padding: 0; }
.stats-histogram li { display: grid; grid-template-columns: 2ch 1fr auto; align-items: center; gap: 8px; margin-bottom: 4px; }
.stats-histogram meter { width: 100%; }
.backup { border-top: 1px solid var(--muted); padding-bottom: 12px; }
.backup form, #backup-manual { display: grid; gap: 8px; margin-top: 12px; }
.backup form button { justify-self: start; }
.backup textarea { width: 100%; resize: vertical; padding: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--muted); border-radius: var(--radius); font: inherit; }
.backup button:disabled { opacity: 0.65; cursor: wait; }
#backup-status { margin: 8px 0 0; }
#backup-status:empty { margin: 0; }
#backup-confirm { width: min(440px, calc(100% - 24px)); }
#backup-confirm h2 { margin-top: 0; }
.backup-actions button:not(.primary) { padding: 8px 12px; background: transparent; color: var(--text); border: 1px solid var(--muted); border-radius: var(--radius); font: inherit; cursor: pointer; }
#archive-dialog { width: min(360px, calc(100% - 24px)); }
#archive-dialog h2 { margin-top: 0; }
#archive-form { display: grid; gap: 8px; margin-bottom: 16px; }
#archive-number { padding: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--muted); border-radius: var(--radius); font: inherit; }
#archive-dialog button:not(.primary) { padding: 8px 12px; background: transparent; color: var(--text); border: 1px solid var(--muted); border-radius: var(--radius); cursor: pointer; }
.legend { list-style: none; padding: 0; }
.legend li { margin: 6px 0; display: flex; align-items: center; gap: 10px; }
.legend .cell { min-height: 28px; min-width: 70px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #000c; padding: 10px 16px; border-radius: var(--radius); }
@media (max-width: 600px) {
  .board th, .cell { min-width: 70px; }
  .cell { min-height: 56px; font-size: 0.78rem; }
}
@media (width < 430px) {
  .board { border-spacing: 4px; }
  .board th, .board td.cell { min-width: 56px; }
  .board td.cell { height: 44px; padding: 4px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  .board tr.new td { animation: none; }
  .confetti { display: none; }
}
.cell.list { background: #241a3a; font-weight: 500; }
.points { font-weight: 700; color: var(--accent-2); }
.badges { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.badges li { background: #2c2045; border-radius: 8px; padding: 6px 8px; font-size: 0.85rem; }
.badges li.locked { opacity: 0.45; }
.page { max-width: 720px; line-height: 1.55; }
@media (min-width: 1024px) {
  main { max-width: 1100px; }
  .board th, .cell { min-width: 112px; }
  .cell { font-size: 0.95rem; min-height: 70px; }
}
dialog { max-height: 90vh; overflow-y: auto; }

/* --- Mise en page : une colonne sur téléphone, deux sur ordinateur --- */
.layout { display: block; }
.panel { background: var(--panel); border: 1px solid #3c2d5c; border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.panel h2 { font-size: 1rem; margin: 0 0 8px; color: var(--accent-2); }
.panel p { margin: 6px 0; }
.home-info { display: grid; gap: 16px; margin-block: 16px; }
.home-info .panel { margin: 0; padding: clamp(16px, 3vw, 24px); }
.home-info h2 { font-size: 1.2rem; }
.home-info h3 { font-size: 1rem; margin: 12px 0 8px; }
.home-info p { line-height: 1.5; }
.home-info :focus-visible { outline: 2px solid #fee27c; outline-offset: 2px; }
.home-info a.primary { justify-self: start; text-decoration: none; }
.home-info a.primary:hover { text-decoration: underline; }
#release-status { font-weight: 700; }
.home-faq details + details { border-top: 1px solid #3c2d5c; }
.home-faq summary { padding: 12px 0; font-weight: 600; cursor: pointer; }
.home-faq summary::marker { color: var(--accent-2); }
.home-faq details p { margin: 0 0 12px; }
.place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0 0 12px; padding: 0; }
.place-grid li { background: var(--bg); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.place-grid p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
@media (min-width: 640px) { .place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.col-side .meta { text-align: left; }
.hints { max-width: 560px; margin: 12px auto; }
.hints ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hint { padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.hint.open { border-left: 4px solid var(--accent); }
.hint.locked { color: var(--muted); }
.side-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.side-stats div { background: var(--bg); border-radius: 8px; padding: 8px; }
.side-stats dt { color: var(--muted); font-size: 0.8rem; }
.side-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 1.2rem; }
#emoji-clues { text-align: center; margin: 8px 0 16px; }
.emoji-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.emoji-slot { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; font-size: 2.6rem; line-height: 1; background: var(--panel); border: 2px solid var(--accent); border-radius: 12px; }
.emoji-slot.empty { border-style: dashed; border-color: #3c2d5c; color: var(--muted); font-size: 1.6rem; font-weight: 700; }
@media (width < 430px) { .emoji-slot { width: 54px; height: 54px; font-size: 2.1rem; } }
@media (min-width: 1100px) {
  main.layout { max-width: 1440px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; padding: 12px 24px; }
  #mode-tabs button { padding-inline: 9px; }
  .col-side { position: sticky; top: 12px; }
  .col-side .panel:first-child { margin-top: 0; }
  .home-info { grid-column: 1; margin-top: 0; }
  .ad-slot.wide { grid-column: 1 / -1; }
  .emoji-slot { width: 84px; height: 84px; font-size: 3.4rem; }
  .board th, .cell { min-width: 120px; }
}
.ad-slot.side { margin: 16px 0; min-height: 250px; }
@media (max-width: 1099px) { .ad-slot.side { display: none !important; } }
.tab-link { border: 1px solid #3c2d5c; background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: 0.9rem; }
.tab-link.on { border-color: var(--accent); }
@media (width < 430px) {
  .board td.cell { overflow-wrap: normal; word-break: normal; hyphens: auto; font-size: 0.72rem; }
}
@media (max-width: 600px) {
  #mode-tabs button:disabled { display: none; }
}
.photo-zone { margin: 8px auto 16px; max-width: 640px; text-align: center; }
.photo-zone img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); border: 2px solid var(--accent); background: var(--panel); }
.photo-zone figcaption { margin-top: 6px; font-size: 0.75rem; }
@media (width < 700px) {
  .photo-zone img { max-width: min(35dvh, 18rem); margin-inline: auto; }
}
.back-bar { padding: 12px 16px 0; }
.back-btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 999px; background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.back-btn:hover, .back-btn:focus-visible { background: #2c2045; }
