:root {
  --ink: #17312b;
  --muted: #6d7975;
  --paper: #f5f3ec;
  --panel: #fffdf8;
  --panel-soft: #eeeee7;
  --line: #d9ded8;
  --accent: #f3c969;
  --accent-deep: #b8781d;
  --teal: #2f6b5f;
  --teal-deep: #173f37;
  --body-glow: #dfece5;
  --header-surface: rgba(245, 243, 236, .88);
  --button-surface: #fff;
  --soft-shadow: rgba(23, 49, 43, .09);
  --accent-text: #17312b;
  font-family: Inter, "Noto Sans", "Noto Sans JP", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f5f1;
  --muted: #aab7b2;
  --paper: #0b1210;
  --panel: #131d1a;
  --panel-soft: #18241f;
  --line: #31413b;
  --accent-deep: #e0ab46;
  --teal: #83c8b8;
  --teal-deep: #d7eee6;
  --body-glow: #183128;
  --header-surface: rgba(11, 18, 16, .91);
  --button-surface: #18231f;
  --soft-shadow: rgba(0, 0, 0, .3);
  --accent-text: #17312b;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 84% 7%, var(--body-glow) 0, transparent 30rem), var(--paper); }
main { flex: 1 0 auto; }
:root.game-fullscreen, :root.game-fullscreen body { overflow: hidden; overscroll-behavior: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { max-width: 100%; }

.site-header { position: relative; z-index: 10; border-bottom: 1px solid var(--line); background: var(--header-surface); backdrop-filter: blur(16px); }
.header-inner { width: min(1520px, 100%); min-height: 82px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 42px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 13px 13px 18px 13px; background: var(--teal-deep); color: var(--accent); font: 700 1.3rem Georgia, serif; transform: rotate(-3deg); box-shadow: 0 8px 18px var(--soft-shadow); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 700 1.55rem Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.brand-copy small { color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .03em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.feedback-nav-link { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--panel); font-size: .8rem; font-weight: 800; text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.feedback-nav-link:hover, .feedback-nav-link:focus-visible { border-color: var(--teal); background: var(--panel-soft); outline: 0; transform: translateY(-1px); }
.feedback-nav-link[aria-current="page"] { border-color: var(--teal-deep); color: var(--panel); background: var(--teal-deep); }
.feedback-nav-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .feedback-nav-link[aria-current="page"] { color: var(--paper); }
.language-switcher { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 5px 14px var(--soft-shadow); }
.language-switcher button { width: 34px; height: 25px; display: grid; place-items: center; padding: 2px; overflow: hidden; border: 1px solid transparent; border-radius: 5px; background: transparent; cursor: pointer; opacity: .72; transition: opacity .16s ease, border-color .16s ease, transform .16s ease; }
.language-switcher button:hover, .language-switcher button:focus-visible { opacity: 1; border-color: var(--teal); outline: 0; transform: translateY(-1px); }
.language-switcher button.active { opacity: 1; border-color: var(--teal-deep); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 18%, transparent); }
.language-switcher img { width: 28px; height: 19px; display: block; object-fit: cover; border-radius: 2px; }
.daily-pill { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: .86rem; font-weight: 700; }
.daily-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.icon-button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); background: var(--panel); cursor: pointer; font-weight: 800; }
.icon-button:hover { border-color: var(--teal); }
.icon-button[aria-pressed="false"] { color: #9a625e; text-decoration: line-through; }
.theme-button { display: grid; place-items: center; padding: 0; }
.theme-button[aria-pressed="false"] { color: var(--ink); text-decoration: none; }
.theme-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: block; }
:root[data-theme="dark"] .brand-mark { background: var(--accent); color: var(--accent-text); }

.home-shell { width: min(1520px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 64px) 72px; }
.site-footer { flex: 0 0 auto; border-top: 1px solid var(--line); color: var(--muted); background: color-mix(in srgb, var(--panel) 58%, transparent); }
.site-footer-inner { width: min(1520px, 100%); margin: 0 auto; padding: 17px clamp(16px, 4vw, 64px); display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; font-size: .68rem; line-height: 1.4; }
.site-footer-item { color: inherit; white-space: nowrap; text-decoration: none; }
a.site-footer-item:hover, a.site-footer-item:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.legal-main { width: min(940px, 100%); margin: 0 auto; padding: clamp(34px, 6vw, 74px) clamp(16px, 4vw, 42px) 80px; }
.legal-heading { margin-bottom: 28px; }
.legal-heading h1 { margin-bottom: 12px; }
.legal-updated { margin: 0; color: var(--muted); font-size: .8rem; }
.legal-card { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 18px 54px var(--soft-shadow); }
.legal-section + .legal-section { margin-top: 34px; padding-top: 34px; border-top: 1px solid var(--line); }
.legal-section h2 { margin-bottom: 16px; font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.legal-section p { margin: 0; line-height: 1.75; }
.legal-section p + p, .legal-section address + p { margin-top: 14px; }
.legal-section address { margin-top: 14px; padding: 17px 19px; border-left: 3px solid var(--accent-deep); border-radius: 0 12px 12px 0; color: var(--ink); background: var(--panel-soft); font-style: normal; line-height: 1.65; }
.legal-section a { color: var(--teal); font-weight: 700; overflow-wrap: anywhere; }
.legal-placeholder { color: var(--accent-deep); }

@media (max-width: 600px) {
  .legal-main { padding-top: 28px; padding-bottom: 54px; }
  .legal-card { border-radius: 18px; }
  .legal-section + .legal-section { margin-top: 27px; padding-top: 27px; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 72px; gap: 10px; padding-inline: 12px; }
  .header-actions { gap: 6px; }
  .language-switcher { gap: 2px; padding: 3px; }
  .language-switcher button { width: 29px; height: 23px; padding: 2px; }
  .language-switcher img { width: 24px; height: 16px; }
  .daily-pill { display: none; }
  .feedback-nav-link { width: 40px; padding: 0; justify-content: center; }
  .feedback-nav-link span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}
@media (max-width: 430px) {
  .brand-copy { display: none; }
  .brand-mark { width: 37px; }
}
.player-bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.player-bar p { margin: 0; font-size: clamp(.96rem, 2vw, 1.08rem); }
.location-trail { min-height: 45px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
.location-trail a { color: var(--teal); font-weight: 750; text-decoration: none; }
.location-trail a:hover { text-decoration: underline; text-underline-offset: 3px; }
.location-trail > span[aria-hidden="true"] { color: var(--accent-deep); font-size: 1rem; }
.location-trail [aria-current="page"] { color: var(--ink); font-weight: 750; }
:root.home-page .location-trail { display: none; }
.profile-link { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 5px 8px 5px 6px; border: 0; border-radius: 999px; color: var(--ink); background: transparent; cursor: pointer; font-weight: 750; text-decoration: none; }
.profile-link:hover { background: var(--panel); }
.profile-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: .78rem; }
.profile-link svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.compact-heading { margin-bottom: 15px; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: .71rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Noto Serif", "Noto Serif JP", serif; font-weight: 600; letter-spacing: -.025em; }
#puzzleTitle,
#categoryTitle,
#puzzleSubtitle,
#aboutEyebrow,
#aboutTitle,
#aboutDescription { font-family: Inter, "Noto Sans", "Noto Sans JP", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1 { font-size: clamp(2.05rem, 4.2vw, 4rem); line-height: .98; }
:root.puzzle-detail-page .page-grid { padding-top: 30px; }
:root.puzzle-detail-page .intro h1 { font-size: clamp(1.6rem, 2.5vw, 2.35rem); line-height: 1.08; }
:root.puzzle-detail-page .intro-copy { margin-top: 8px; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2.15rem); }
.compact-heading h2 { font-size: clamp(1.25rem, 2.2vw, 1.65rem); }
.category-list::-webkit-scrollbar { display: none; }

/* Accueil : laisser davantage de place au puzzle du jour */
:root.home-page .player-bar { min-height: 48px; }
:root.home-page .player-bar p { font-size: .9rem; }
:root.home-page .profile-link { min-height: 34px; gap: 6px; padding: 3px 6px 3px 4px; font-size: .8rem; }
:root.home-page .profile-avatar { width: 26px; height: 26px; font-size: .68rem; }
:root.home-page .profile-link svg { width: 14px; }
:root.home-page .page-grid { padding-top: 18px; }
:root.home-page .intro { margin-top: 0; margin-bottom: 16px; }
:root.home-page .intro h1 { font-size: clamp(1.6rem, 2.8vw, 2.65rem); line-height: 1.05; }
:root.home-page .intro-copy { margin-top: 7px; }

.page-grid { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: clamp(24px, 3vw, 46px); align-items: start; padding-top: 36px; }
.category-sidebar { position: sticky; top: 22px; min-width: 0; padding: 22px 16px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 18px 50px var(--soft-shadow); }
.sidebar-heading { padding: 0 7px 17px; border-bottom: 1px solid var(--line); }
.sidebar-heading h2 { font-size: 1.45rem; }
.puzzle-search { display: grid; gap: 6px; margin: 0 0 16px; }
.puzzle-search label { font-size: .8rem; font-weight: 700; }
.puzzle-search > div { display: flex; flex-wrap: wrap; gap: 6px; }
.puzzle-search input { flex: 1 1 90px; min-width: 0; color: var(--ink); background: var(--panel); }
.puzzle-search button { color: var(--panel); background: var(--teal-deep); cursor: pointer; }
.puzzle-search input, .puzzle-search button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .78rem; }
.category-list { min-width: 0; display: grid; gap: 5px; padding: 11px 0; }
.category-link { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 55px; padding: 7px 8px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.category-link:hover, .category-link.active { background: var(--panel-soft); }
.category-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.category-link > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.category-link strong { font-size: .82rem; }
.category-link small { color: var(--muted); font-size: .64rem; }
.category-link > span:last-child { color: var(--muted); font-size: 1.15rem; }
.category-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: .72rem; }
.category-icon.animals { background: #e4eee8; color: #39715f; }
.category-icon.landscapes { background: #e3ebf0; color: #4e7287; }
.category-icon.monuments { background: #f3e7d8; color: #996d3d; }
.category-icon.art { background: #eee1eb; color: #875777; }
.category-icon.travel { background: #f4ead1; color: #9b7428; }
.category-icon.vehicles { background: #e1e7f5; color: #465c93; }
.category-icon.events { background: #f3e2e0; color: #8e4a50; }
:root[data-theme="dark"] .category-icon { filter: brightness(.76) saturate(.9); }
.sidebar-note { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; margin-top: 3px; padding: 13px 10px; border-radius: 13px; background: var(--teal-deep); color: var(--panel); }
.sidebar-note > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.sidebar-note p { margin: 0; display: grid; gap: 4px; }
.sidebar-note strong { font-size: .72rem; line-height: 1.3; }
.sidebar-note small { color: color-mix(in srgb, var(--panel) 72%, transparent); font-size: .62rem; line-height: 1.4; }

.daily-content { min-width: 0; }
.puzzle-detail-page .home-introduction { display: none; }
.home-welcome { margin: 0 0 4px; color: var(--ink); font-size: 14px; line-height: 1.5; }
.home-catalog-intro { margin: 0 0 12px; color: var(--ink); font-size: 12px; line-height: 1.5; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 5px 0 22px; }
.intro-copy { margin: 12px 0 0; color: var(--muted); font-family: Georgia, "Noto Serif", serif; font-size: 1rem; }
.stats { flex: 0 0 auto; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 8px 30px var(--soft-shadow); }
.stats div { min-width: 90px; padding: 11px 14px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats span { display: block; margin-bottom: 2px; color: var(--muted); font-size: .68rem; }
.stats strong { font-variant-numeric: tabular-nums; font-size: .98rem; }

.home-daily-card { display: none; }
.home-daily-credit { display: none; }
.game-photo-credit { display: none; }
:root.home-page .stats, :root.home-page .workspace { display: none; }
:root.home-page .home-daily-card { position: relative; display: block; width: 66.6667%; min-height: 260px; margin-inline: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: var(--panel); box-shadow: 0 24px 60px var(--soft-shadow); }
:root.home-page .home-daily-credit { display: block; width: 66.6667%; margin: 10px auto 0; color: var(--muted); font-size: .76rem; text-align: center; }
:root.puzzle-detail-page .game-photo-credit { display: block; width: min(100%, 1080px); margin: 10px auto 0; color: var(--muted); font-size: .76rem; text-align: center; }
:root.catalog-empty .home-daily-card,
:root.catalog-empty .home-daily-credit,
:root.catalog-empty .game-photo-credit,
:root.catalog-empty .workspace,
:root.catalog-empty .details,
:root.catalog-empty .related { display: none; }
.home-daily-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.home-daily-image-link { display: block; }
.home-daily-image-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.home-daily-image-link img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.home-daily-start { position: absolute; left: clamp(14px, 2.5vw, 28px); bottom: clamp(14px, 2.5vw, 26px); min-height: 48px; display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 8px; border: 1px solid rgba(255, 255, 255, .62); border-radius: 999px; color: #fff; background: rgba(9, 28, 23, .88); box-shadow: 0 12px 32px rgba(4, 18, 14, .3); backdrop-filter: blur(12px); cursor: pointer; }
.home-daily-start > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-text); background: var(--accent); font-size: 1rem; }
.home-daily-start strong { font-size: .78rem; }
.home-daily-selection { position: absolute; z-index: 2; right: clamp(12px, 2vw, 24px); top: 50%; width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); display: grid; grid-template-columns: minmax(175px, .8fr) minmax(240px, 1.2fr); overflow: auto; border: 1px solid rgba(255, 255, 255, .42); border-radius: 18px; color: #f7faf8; background: rgba(12, 32, 27, .95); box-shadow: 0 22px 60px rgba(3, 15, 12, .44); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; pointer-events: none; transform: translate(28px, -50%); transition: opacity .24s ease, visibility .24s ease, transform .3s cubic-bezier(.2, .75, .25, 1); }
.home-daily-selection .cut-type-menu { border-right: 1px solid rgba(255, 255, 255, .14); }
.home-daily-card.selection-open .home-daily-selection, .home-daily-card:focus-within .home-daily-selection { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, -50%); }

@media (hover: hover) and (pointer: fine) {
  .home-daily-card:hover .home-daily-selection { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, -50%); }
  .home-daily-start { display: none; }
}

.workspace { display: grid; gap: 13px; }
.controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 10px 32px var(--soft-shadow); }
.control-group { display: flex; align-items: center; gap: 10px; }
.control-label { color: var(--muted); font-size: .7rem; font-weight: 800; }
.puzzle-configuration { font-size: .79rem; font-weight: 800; }
.change-puzzle-button, .control-button { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--button-surface); color: var(--ink); cursor: pointer; font-weight: 700; }
.change-puzzle-button { padding: 0 10px; color: var(--teal); font-size: .72rem; }
.change-puzzle-button:hover, .control-button:hover { border-color: var(--teal); }
.control-actions { display: flex; gap: 6px; }
.control-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; font-size: .76rem; }
.control-button > span:first-child { color: var(--teal); font-size: 1rem; }
.fullscreen-control-icon { width: 19px; height: 19px; display: block; object-fit: contain; }
.control-button:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); }
.hint { flex-basis: 100%; margin: -2px 2px 1px; color: var(--muted); font-size: .66rem; }

.board-wrap { --board-gutter: clamp(7px, 1vw, 12px); --board-rail-height: clamp(58px, 6vw, 66px); position: relative; width: min(103%, 1145.772px); margin: 0 auto; padding: var(--board-gutter); overflow: hidden; border-radius: 0; background: #18302a; box-shadow: 0 24px 60px rgba(19, 35, 31, .2); }
.board-wrap.game-active { padding-bottom: calc(var(--board-gutter) + var(--board-rail-height)); }
.board-wrap.game-active::before { position: absolute; z-index: 0; inset: var(--board-gutter) var(--board-gutter) calc(var(--board-gutter) + var(--board-rail-height)); content: ""; background: linear-gradient(122.35deg, #28455f, #0b1b2a); pointer-events: none; }
.board-wrap.game-active[data-game-background="black"]::before { background: linear-gradient(122.35deg, #24292b, #07090a); }
.board-wrap.game-active[data-game-background="navy"]::before { background: linear-gradient(122.35deg, #28455f, #0b1b2a); }
.board-wrap.game-active[data-game-background="green"]::before { background: linear-gradient(122.35deg, #3b715f, #102c24); }
.board-wrap.game-active[data-game-background="white"]::before { background: linear-gradient(122.35deg, #fff, #eef2f3); }
.board-wrap.game-active::after { position: absolute; z-index: 6; right: var(--board-gutter); bottom: var(--board-gutter); left: var(--board-gutter); height: var(--board-rail-height); content: ""; border-top: 1px solid rgba(255, 255, 255, .26); background: linear-gradient(180deg, rgba(13, 31, 34, .96), rgba(6, 18, 21, .98)); box-shadow: 0 -7px 20px rgba(0, 0, 0, .16); pointer-events: none; }
.board { position: relative; z-index: 1; display: block; width: 100%; height: auto; aspect-ratio: 1200 / 760; border-radius: 0; background: #55758e; cursor: grab; touch-action: none; user-select: none; }
.board-wrap:not(.game-active) .board { cursor: pointer; }
.board.grabbing { cursor: grabbing; }
.board.selecting { cursor: crosshair; }
.board:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
.board-wrap.zooming-in .board:focus-visible,
.board-wrap.zooming-out .board:focus-visible { outline: 0; }

.camera-direction-controls { position: absolute; z-index: 9; inset: var(--board-gutter) var(--board-gutter) calc(var(--board-gutter) + var(--board-rail-height)); pointer-events: none; }
.camera-direction-controls[hidden] { display: none; }
.camera-direction-button { position: absolute; width: clamp(38px, 4vw, 48px); height: clamp(38px, 4vw, 48px); display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .72); border-radius: 50%; color: #f3c969; background: rgba(7, 18, 16, .82); box-shadow: 0 8px 24px rgba(0, 0, 0, .32); backdrop-filter: blur(9px); cursor: pointer; pointer-events: auto; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.camera-direction-button[hidden] { display: none; }
.camera-direction-button span { width: 17px; height: 15px; display: block; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .28)); }
.camera-direction-button:hover, .camera-direction-button:focus-visible { border-color: #f3c969; background: rgba(20, 48, 42, .94); outline: 3px solid rgba(243, 201, 105, .3); transform: scale(1.08); }
.camera-direction-up { top: 12px; left: 50%; transform: translateX(-50%); }
.camera-direction-up:hover, .camera-direction-up:focus-visible { transform: translateX(-50%) scale(1.08); }
.camera-direction-right { top: 50%; right: 12px; transform: translateY(-50%); }
.camera-direction-right span { transform: rotate(90deg); }
.camera-direction-right:hover, .camera-direction-right:focus-visible { transform: translateY(-50%) scale(1.08); }
.camera-direction-down { bottom: 12px; left: 50%; transform: translateX(-50%); }
.camera-direction-down span { transform: rotate(180deg); }
.camera-direction-down:hover, .camera-direction-down:focus-visible { transform: translateX(-50%) scale(1.08); }
.camera-direction-left { top: 50%; left: 12px; transform: translateY(-50%); }
.camera-direction-left span { transform: rotate(-90deg); }
.camera-direction-left:hover, .camera-direction-left:focus-visible { transform: translateY(-50%) scale(1.08); }

.board-status-controls { position: absolute; z-index: 10; right: calc(var(--board-gutter) + 6px); bottom: calc(var(--board-gutter) + 6px); display: none; align-items: center; gap: 8px; }
.board-wrap.game-active .board-status-controls { display: flex; }
.board-zoom-controls { position: absolute; z-index: 8; left: 50%; bottom: calc(var(--board-gutter) + 6px); display: none; gap: 4px; transform: translateX(-50%); }
.board-wrap.game-active .board-zoom-controls { display: flex; }
.board-zoom-controls button { width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, .7); border-radius: 12px; color: #fff; background: #102724; font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.board-zoom-controls button:focus-visible { outline: 2px solid #f3c969; outline-offset: 2px; }
.board-zoom-controls button[aria-disabled="true"] { opacity: .55; cursor: default; }
.board-timer { min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border: 1px solid rgba(255, 255, 255, .56); border-radius: 999px; color: #fff; background: rgba(7, 18, 16, .86); box-shadow: 0 7px 18px rgba(0, 0, 0, .3); backdrop-filter: blur(12px); }
.pause-timer-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 8px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; color: #f3c969; background: rgba(255, 255, 255, .08); cursor: pointer; }
.pause-timer-button svg { width: 100%; height: 100%; fill: currentColor; }
.pause-timer-button:hover, .pause-timer-button:focus-visible, .pause-timer-button[aria-pressed="true"] { border-color: #f3c969; background: rgba(243, 201, 105, .16); outline: 3px solid rgba(243, 201, 105, .24); }
.pause-timer-button:disabled { opacity: .48; cursor: not-allowed; }
.board-timer-value strong { min-width: 4.4ch; display: block; font-size: .92rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; text-align: center; }
.game-pause-overlay { position: absolute; inset: var(--board-gutter) var(--board-gutter) calc(var(--board-gutter) + var(--board-rail-height)); z-index: 7; display: grid; place-items: center; color: #fff; background: rgba(4, 13, 17, .48); pointer-events: none; backdrop-filter: blur(2px); }
.game-pause-overlay[hidden] { display: none; }
.game-pause-overlay strong { padding: 14px 28px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; background: rgba(7, 18, 16, .86); box-shadow: 0 14px 38px rgba(0, 0, 0, .35); font-size: clamp(1.15rem, 3vw, 2rem); font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.board-wrap.game-paused .board { cursor: pointer; }
.board-wrap.game-paused .in-game-preview-toggle,
.board-wrap.game-paused .edge-only-toggle,
.board-wrap.game-paused .hint-button,
.board-wrap.game-paused .group-shuffle-button,
.board-wrap.game-paused .fullscreen-menu { pointer-events: none; }
.board-wrap.fullscreen-active .game-pause-overlay { inset: 0 0 var(--board-rail-height); }

.in-game-preview-toggle { position: absolute; z-index: 8; top: clamp(15px, 2vw, 24px); right: clamp(15px, 2vw, 24px); width: clamp(43px, 5vw, 54px); height: clamp(43px, 5vw, 54px); display: none; place-items: center; padding: 6px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .88); border-radius: 13px; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.board-wrap.game-active .in-game-preview-toggle { display: grid; }
.board-wrap.game-active .in-game-preview-toggle[aria-expanded="true"] { display: none; }
.in-game-preview-toggle:hover, .in-game-preview-toggle:focus-visible, .in-game-preview-toggle.active { border-color: #f3c969; outline: 0; box-shadow: 0 0 0 3px rgba(243, 201, 105, .25), 0 10px 28px rgba(0, 0, 0, .32); transform: translateY(-1px); }
.in-game-preview-toggle img { width: 100%; height: 100%; display: block; object-fit: contain; }
.in-game-preview { position: absolute; z-index: 7; top: clamp(7px, 1vw, 12px); right: clamp(7px, 1vw, 12px); width: clamp(190px, 32%, 320px); aspect-ratio: 16 / 10; overflow: hidden; border: 3px solid rgba(255, 255, 255, .94); border-radius: 0; background: transparent; box-shadow: 0 16px 38px rgba(0, 0, 0, .34); pointer-events: none; transition: width .22s ease; }
.in-game-preview[data-size="small"] { width: clamp(145px, 24%, 230px); }
.in-game-preview[data-size="large"] { width: clamp(260px, 46%, 470px); }
.in-game-preview[data-size="xlarge"] { width: clamp(390px, 78%, 840px); }
.in-game-preview[hidden] { display: none; }
.in-game-preview-image { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 1; pointer-events: none; transition: opacity .22s ease; }
.in-game-preview.pointer-over .in-game-preview-image { opacity: .3; }
.in-game-preview.resizing { user-select: none; transition: none; }
.in-game-preview.resizing .in-game-preview-image { opacity: .3; }
.in-game-preview-actions { position: absolute; z-index: 5; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 5px; pointer-events: auto; }
.in-game-preview-control { width: clamp(34px, 4vw, 42px); height: clamp(34px, 4vw, 42px); display: grid; place-items: center; padding: 3px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .92); border-radius: 11px; color: #1268a7; background: rgba(255, 255, 255, .92); box-shadow: 0 6px 18px rgba(0, 0, 0, .32); cursor: pointer; font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 900; line-height: 1; }
.in-game-preview-control:hover, .in-game-preview-control:focus-visible { border-color: #f3c969; outline: 3px solid rgba(243, 201, 105, .28); }
.in-game-preview-control:disabled { opacity: .46; cursor: not-allowed; }
.in-game-preview-collapse img { width: 100%; height: 100%; display: block; object-fit: contain; }
.in-game-preview-resize-edge { position: absolute; z-index: 2; display: block; pointer-events: auto; touch-action: none; }
.in-game-preview-resize-left { top: 0; bottom: 0; left: 0; width: 12px; cursor: ew-resize; }
.in-game-preview-resize-bottom { right: 0; bottom: 0; left: 0; height: 12px; cursor: ns-resize; }
.in-game-preview-resize-corner { z-index: 4; left: 0; bottom: 0; width: 20px; height: 20px; cursor: nesw-resize; }
.in-game-preview-resize-left::after, .in-game-preview-resize-bottom::after { position: absolute; content: ""; border-radius: 999px; background: rgba(18, 104, 167, .72); opacity: 0; transition: opacity .18s ease; }
.in-game-preview-resize-left::after { left: 2px; top: 35%; width: 3px; height: 30%; }
.in-game-preview-resize-bottom::after { left: 40%; bottom: 2px; width: 20%; height: 3px; }
.in-game-preview:not(.resizing) .in-game-preview-resize-edge:hover::after, .in-game-preview.resizing .in-game-preview-resize-edge::after { opacity: 1; }

.edge-only-toggle { position: absolute; z-index: 8; left: clamp(68px, 8vw, 88px); bottom: calc(var(--board-gutter) + 6px); width: clamp(43px, 5vw, 54px); height: clamp(43px, 5vw, 54px); display: none; place-items: center; padding: 5px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .88); border-radius: 13px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.board-wrap.game-active .edge-only-toggle { display: grid; }
.edge-only-toggle:hover, .edge-only-toggle:focus-visible, .edge-only-toggle[aria-pressed="true"] { border-color: #f3c969; outline: 0; box-shadow: 0 0 0 3px rgba(243, 201, 105, .25), 0 10px 28px rgba(0, 0, 0, .32); transform: translateY(-1px); }
.edge-only-toggle:disabled { display: none; }
.edge-only-icon { width: 100%; height: 100%; display: block; object-fit: contain; }
.edge-only-active-icon { position: relative; width: 100%; height: 100%; display: none; place-items: center; overflow: hidden; border-radius: 7px; }
.edge-only-active-icon::after { position: absolute; inset: -8px; content: ""; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(8, 55, 104, .7) 6px 8px); pointer-events: none; }
.edge-only-toggle[aria-pressed="true"] .edge-only-icon-corner { display: none; }
.edge-only-toggle[aria-pressed="true"] .edge-only-active-icon { display: grid; }

.hint-button { position: absolute; z-index: 8; left: calc(var(--board-gutter) + 6px); bottom: calc(var(--board-gutter) + 6px); width: clamp(43px, 5vw, 54px); height: clamp(43px, 5vw, 54px); display: none; place-items: center; padding: 7px; border: 2px solid rgba(255, 255, 255, .88); border-radius: 13px; color: #8a6410; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.board-wrap.game-active .hint-button { display: grid; }
.hint-button svg { width: 100%; height: 100%; fill: rgba(243, 201, 105, .22); stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.hint-button:hover, .hint-button:focus-visible, .hint-button.active { border-color: #f3c969; color: #c78b10; outline: 0; box-shadow: 0 0 0 3px rgba(243, 201, 105, .28), 0 10px 28px rgba(0, 0, 0, .32); transform: translateY(-1px); }
.hint-button.active svg { animation: hint-bulb-pulse .55s ease-in-out infinite alternate; }
.hint-button:disabled { display: none; }
@keyframes hint-bulb-pulse { to { filter: drop-shadow(0 0 5px rgba(255, 214, 91, .95)); transform: scale(1.06); } }

.group-shuffle-button { position: absolute; z-index: 8; left: clamp(128px, 15vw, 148px); bottom: calc(var(--board-gutter) + 6px); width: clamp(43px, 5vw, 54px); height: clamp(43px, 5vw, 54px); display: none; place-items: center; padding: 7px; border: 2px solid rgba(255, 255, 255, .88); border-radius: 13px; color: #1268a7; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.board-wrap.game-active .group-shuffle-button { display: grid; }
.group-shuffle-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.group-shuffle-button:hover, .group-shuffle-button:focus-visible { border-color: #f3c969; color: #0d7894; outline: 0; box-shadow: 0 0 0 3px rgba(243, 201, 105, .28), 0 10px 28px rgba(0, 0, 0, .32); transform: translateY(-1px); }
.group-shuffle-button:active { transform: translateY(0) rotate(4deg); }
.group-shuffle-button:disabled { display: none; }

.board-wrap.fullscreen-active { --board-gutter: 0px; --board-rail-height: 58px; position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; max-width: none; margin: 0; padding: 0 0 var(--board-rail-height); display: flex; align-items: center; justify-content: center; border-radius: 0; box-shadow: none; background: #0b1b2a; }
.board-wrap.fullscreen-active[data-game-background="black"] { background: #050708; }
.board-wrap.fullscreen-active[data-game-background="navy"] { background: #0b1b2a; }
.board-wrap.fullscreen-active[data-game-background="green"] { background: #102c24; }
.board-wrap.fullscreen-active[data-game-background="white"] { background: #fff; }
.board-wrap.fullscreen-active .board { width: min(100vw, calc((100vh - var(--board-rail-height)) * 1.578947)); width: min(100vw, calc((100dvh - var(--board-rail-height)) * 1.578947)); height: min(calc(100vh - var(--board-rail-height)), calc(100vw * .633333)); height: min(calc(100dvh - var(--board-rail-height)), calc(100vw * .633333)); max-width: none; flex: 0 0 auto; border-radius: 0; }
.board-wrap.fullscreen-active .in-game-preview { top: 0; right: 0; }
.board-wrap.fullscreen-active .success { inset: 0; border-radius: 0; }
.board-wrap.fullscreen-active .puzzle-launcher { inset: 0; border-radius: 0; }

.fullscreen-menu { display: flex; position: absolute; z-index: 9; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); align-items: flex-start; gap: 8px; color: #fff; pointer-events: auto; }
.fullscreen-menu-trigger { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .42); border-radius: 999px; color: #fff; background: rgba(7, 18, 16, .84); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); backdrop-filter: blur(12px); cursor: pointer; font-weight: 800; }
.fullscreen-menu-trigger:hover, .fullscreen-menu-trigger:focus-visible { border-color: #f3c969; outline: 0; }
.fullscreen-menu-trigger > span { color: #f3c969; font-size: 1.05rem; }
.fullscreen-toggle-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 2px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .55); border-radius: 11px; background: rgba(255, 255, 255, .9); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); cursor: pointer; }
.fullscreen-toggle-button img { width: 100%; height: 100%; display: block; object-fit: contain; }
.fullscreen-toggle-button:hover, .fullscreen-toggle-button:focus-visible { border-color: #f3c969; outline: 3px solid rgba(243, 201, 105, .28); }
.fullscreen-menu-panel { position: absolute; left: 0; top: calc(100% + 8px); width: 220px; padding: 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 15px; background: rgba(7, 18, 16, .94); box-shadow: 0 18px 48px rgba(0, 0, 0, .38); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transform: translateY(-9px); transition: opacity .2s ease, visibility .2s ease, transform .2s ease; }
.fullscreen-menu.open .fullscreen-menu-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.fullscreen-menu-panel > p { margin: 0 0 10px; color: #f3c969; font-size: .65rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.background-options { display: grid; gap: 6px; }
.background-options button { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .06); cursor: pointer; font-size: .75rem; font-weight: 750; text-align: left; }
.background-options button:hover, .background-options button:focus-visible, .background-options button[aria-pressed="true"] { border-color: #f3c969; background: rgba(243, 201, 105, .14); outline: 0; }
.background-options i { width: 17px; height: 17px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; background: #050708; }
.background-options [data-game-background="navy"] i { background: #0b1b2a; }
.background-options [data-game-background="green"] i { background: #1d5947; }
.background-options [data-game-background="white"] i { border-color: rgba(255, 255, 255, .8); background: #fff; }

.puzzle-launcher { position: absolute; inset: clamp(7px, 1vw, 12px); z-index: 3; border-radius: 0; pointer-events: none; }
.launcher-trigger { position: absolute; left: clamp(14px, 2.5vw, 30px); bottom: clamp(14px, 2.5vw, 28px); display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 8px 15px 8px 9px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; color: #fff; background: rgba(10, 30, 25, .82); box-shadow: 0 12px 32px rgba(4, 18, 14, .28); backdrop-filter: blur(12px); cursor: pointer; pointer-events: auto; text-align: left; transition: transform .24s ease, background .24s ease; }
.launcher-trigger:hover, .launcher-trigger:focus-visible { background: rgba(10, 30, 25, .96); transform: translateY(-2px); outline: 0; }
.launcher-trigger-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 1.1rem; font-weight: 900; }
.launcher-trigger > span:last-child { display: grid; gap: 2px; }
.launcher-trigger strong { font-size: .82rem; }
.launcher-trigger small { color: rgba(255, 255, 255, .72); font-size: .64rem; }

.cut-panel { position: absolute; right: clamp(12px, 2vw, 24px); top: 50%; width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); display: grid; grid-template-columns: minmax(175px, .8fr) minmax(240px, 1.2fr); overflow: auto; border: 1px solid rgba(255, 255, 255, .42); border-radius: 18px; color: #f7faf8; background: rgba(12, 32, 27, .94); box-shadow: 0 22px 60px rgba(3, 15, 12, .42); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; pointer-events: auto; transform: translate(34px, -50%); transition: opacity .24s ease, visibility .24s ease, transform .3s cubic-bezier(.2, .75, .25, 1); }
.board-wrap.menu-open .cut-panel, .puzzle-launcher:focus-within .cut-panel { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.cut-panel-close { position: absolute; z-index: 2; top: 7px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .08); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.cut-panel-close:hover, .cut-panel-close:focus-visible { border-color: #f3c969; color: #f3c969; outline: 0; }
.cut-type-menu, .piece-submenu { padding: clamp(14px, 2vw, 20px); }
.cut-type-menu { border-right: 1px solid rgba(255, 255, 255, .14); }
.cut-panel-label { margin: 0 0 10px; color: #f3c969; font-size: .65rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.cut-type-option { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 11px; color: #fff; background: transparent; cursor: pointer; text-align: left; }
.cut-type-option + .cut-type-option { margin-top: 5px; }
.cut-type-option:hover, .cut-type-option:focus-visible, .cut-type-option.active { border-color: rgba(243, 201, 105, .55); background: rgba(243, 201, 105, .13); outline: 0; }
.cut-type-option > span:first-child { display: grid; gap: 2px; }
.cut-type-option strong { font-size: .8rem; }
.cut-type-option small { color: rgba(255, 255, 255, .62); font-size: .61rem; }
.cut-type-option > span:last-child { color: #f3c969; font-size: 1.25rem; }
.piece-submenu { background: rgba(255, 255, 255, .045); }
.piece-submenu-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.piece-submenu-heading .cut-panel-label { margin: 0; }
.piece-submenu-heading strong { color: #fff; font-size: .75rem; }
.piece-count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.piece-count-grid button { min-height: 40px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; color: #fff; background: rgba(255, 255, 255, .07); cursor: pointer; font-weight: 800; }
.piece-count-grid button:hover, .piece-count-grid button:focus-visible { border-color: #f3c969; background: #f3c969; color: #17312b; outline: 0; transform: translateY(-1px); }
.piece-submenu-note { margin: 10px 0 0; color: rgba(255, 255, 255, .62); font-size: .61rem; line-height: 1.4; }

@media (hover: hover) and (pointer: fine) {
  .board-wrap:not(.game-active):hover .cut-panel { opacity: 1; visibility: visible; transform: translate(0, -50%); }
}

.success { position: absolute; inset: clamp(7px, 1vw, 12px); z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: clamp(26px, 4vw, 54px); border-radius: 0; color: #fff; text-align: center; background: linear-gradient(180deg, rgba(10, 27, 23, .9) 0%, rgba(10, 27, 23, .08) 38%, rgba(10, 27, 23, .05) 58%, rgba(10, 27, 23, .9) 100%); pointer-events: none; }
.success[hidden] { display: none; }
.completion-heading { max-width: 620px; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.completion-label { margin: 0 0 6px; color: #f7d77f; font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.completion-heading h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 3.4rem); line-height: 1.05; }
.completion-heading p:last-child { margin: 10px 0 0; color: rgba(255, 255, 255, .86); font-size: .92rem; }
.completion-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; width: 100%; pointer-events: auto; }
.completion-action { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .46); border-radius: 999px; background: rgba(11, 32, 27, .82); color: #fff; text-decoration: none; font-weight: 750; cursor: pointer; backdrop-filter: blur(12px); }
.completion-action:hover { border-color: #fff; background: rgba(11, 32, 27, .96); }
.completion-action-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.completion-action-primary:hover { background: #ffdc7d; border-color: #ffdc7d; }

.details, .related { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(280px, 1fr); gap: 36px; align-items: end; margin-top: clamp(30px, 5vw, 62px); padding-top: 28px; border-top: 1px solid var(--line); }
.related { display: block; scroll-margin-top: 24px; margin-top: 32px; padding-bottom: 8px; }
.about-copy { display: grid; justify-items: start; gap: 13px; }
.about-copy > p { margin: 0; color: var(--muted); font-family: Georgia, "Noto Serif", serif; font-size: 1.02rem; line-height: 1.65; }
.wikipedia-link { display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font-size: .82rem; font-weight: 800; text-underline-offset: 3px; }
.wikipedia-link[hidden] { display: none; }
.wikipedia-link:hover { color: var(--ink); }
.related-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 17px; }
.related-heading > p:last-child { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.55; }
.puzzle-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.puzzle-card { min-width: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 11px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); box-shadow: 0 8px 28px var(--soft-shadow); cursor: pointer; text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.puzzle-card:hover, .puzzle-card:focus-visible { transform: translateY(-2px); border-color: var(--teal); outline: 0; box-shadow: 0 14px 34px var(--soft-shadow); }
.puzzle-card { text-decoration: none; }
.puzzle-card[aria-current="true"] { border-color: var(--accent-deep); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 38%, transparent); }
.puzzle-card img { width: 82px; height: 66px; object-fit: cover; border-radius: 0; }
.puzzle-card > span { min-width: 0; display: grid; gap: 4px; }
.puzzle-card strong, .puzzle-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puzzle-card strong { font-size: .82rem; }
.puzzle-card small { color: var(--muted); font-size: .65rem; }
.puzzle-card i { grid-column: 2; color: var(--teal); font-size: .68rem; font-style: normal; font-weight: 800; }
.gallery-empty { grid-column: 1 / -1; min-height: 150px; display: flex; align-items: center; justify-content: center; gap: 15px; padding: 28px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); background: color-mix(in srgb, var(--panel) 72%, transparent); text-align: left; }
.gallery-empty > span { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: var(--panel-soft); color: var(--teal); font-size: 1.2rem; }
.gallery-empty div { display: grid; gap: 4px; }
.gallery-empty strong { color: var(--ink); font-size: .9rem; }
.gallery-empty p { margin: 0; font-size: .76rem; line-height: 1.5; }

dialog { width: min(92vw, 820px); padding: 12px; border: 0; border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(10, 25, 21, .72); backdrop-filter: blur(5px); }
dialog img { display: block; width: 100%; border-radius: 11px; }
dialog p { margin: 11px 4px 2px; font-family: Georgia, serif; font-size: 1.1rem; }

.progress-warning-dialog { width: min(92vw, 520px); padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 24px; }
.progress-warning-card { display: grid; justify-items: center; padding: clamp(26px, 5vw, 42px); text-align: center; }
.progress-warning-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid color-mix(in srgb, #f3c969 72%, var(--line)); border-radius: 50%; color: #684b08; background: #f3c969; box-shadow: 0 10px 30px rgba(243, 201, 105, .25); font-family: Georgia, serif; font-size: 1.7rem; font-weight: 800; }
.progress-warning-eyebrow { margin: 0 0 7px; color: var(--accent); font-family: inherit; font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.progress-warning-dialog h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.65rem, 5vw, 2.25rem); line-height: 1.06; }
.progress-warning-dialog #progressWarningDescription { max-width: 410px; }
.progress-warning-dialog #progressWarningDescription p { margin: 16px 0 0; color: var(--muted); font-family: inherit; font-size: .98rem; line-height: 1.6; }
.progress-warning-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.progress-warning-actions button { min-height: 48px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 820; }
.progress-warning-cancel { color: var(--ink); background: transparent; }
.progress-warning-cancel:hover, .progress-warning-cancel:focus-visible { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.progress-warning-confirm { color: #092219; background: #f3c969; }
.progress-warning-confirm:hover, .progress-warning-confirm:focus-visible { border-color: #f3c969; outline: 3px solid rgba(243, 201, 105, .28); filter: brightness(1.04); }

@media (max-width: 520px) {
  .progress-warning-actions { grid-template-columns: 1fr; }
  .progress-warning-confirm { grid-row: 1; }
}
#closePreview { position: absolute; right: 21px; top: 21px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(19, 35, 31, .88); color: white; font-size: 1.45rem; cursor: pointer; }

@media (max-width: 1080px) {
  .page-grid { grid-template-columns: 190px minmax(0, 1fr); gap: 24px; }
  .category-sidebar { padding-inline: 11px; }
  .category-link { grid-template-columns: 32px minmax(0, 1fr); }
  .category-link > span:last-child { display: none; }
  .intro { display: grid; }
  .stats { width: 100%; }
  .stats div { flex: 1; }
}

@media (max-width: 790px) {
  .header-inner { min-height: 70px; }
  .brand-copy small, .daily-pill { display: none; }
  .home-shell { padding-bottom: 50px; }
  .player-bar { min-height: 60px; }
  .page-grid { grid-template-columns: minmax(0, 1fr); padding-top: 26px; }
  .category-sidebar { position: static; overflow: hidden; padding: 15px; }
  .sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
  .sidebar-heading .eyebrow { display: none; }
  .sidebar-heading h2 { font-size: 1.2rem; }
  .category-list { grid-auto-flow: column; grid-auto-columns: minmax(145px, 1fr); overflow-x: auto; padding: 10px 0 3px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .category-link { min-height: 50px; scroll-snap-align: start; }
  .category-link small { display: none; }
  .sidebar-note { display: none; }
  .intro { margin-top: 0; }
  .controls { align-items: flex-start; }
  .control-group { width: 100%; justify-content: space-between; }
  .control-actions { flex: 1; }
  .control-button { flex: 1; }
  .board-wrap { width: 100%; }
  .details { grid-template-columns: 1fr; gap: 13px; }
  .related-heading { display: grid; gap: 8px; }
  .puzzle-gallery { grid-template-columns: 1fr; }
  :root.home-page .home-daily-card { width: 100%; }
  :root.home-page .home-daily-credit { width: 100%; }
}

@media (max-width: 520px) {
  .header-inner { padding-inline: 16px; }
  .brand-mark { width: 38px; }
  .brand-copy strong { font-size: 1.35rem; }
  .icon-button { width: 38px; height: 38px; }
  .player-bar { gap: 8px; }
  .profile-link { font-size: .8rem; }
  .profile-avatar { display: none; }
  h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .intro-copy { font-size: .91rem; }
  .stats div { min-width: 0; padding: 9px 6px; }
  .stats span { font-size: .62rem; }
  .stats strong { font-size: .9rem; }
  .control-group { display: grid; grid-template-columns: 1fr auto; }
  .control-label { grid-column: 1 / -1; }
  .control-actions { width: 100%; }
  .control-button { padding-inline: 6px; font-size: .7rem; }
  .hint { line-height: 1.4; }
  .board-wrap { --board-gutter: 6px; --board-rail-height: 52px; padding: var(--board-gutter); border-radius: 0; }
  .board-wrap.game-active { padding-bottom: calc(var(--board-gutter) + var(--board-rail-height)); }
  .board { border-radius: 0; }
  .in-game-preview-toggle { top: 12px; right: 12px; width: 40px; height: 40px; padding: 5px; border-radius: 10px; }
  .in-game-preview { top: 6px; right: 6px; width: min(43%, 220px); min-width: 150px; border-width: 2px; border-radius: 0; }
  .in-game-preview[data-size="small"] { width: min(34%, 165px); min-width: 130px; }
  .in-game-preview[data-size="large"] { width: min(70%, 330px); min-width: 230px; }
  .in-game-preview[data-size="xlarge"] { width: min(92%, 460px); min-width: 270px; }
  .in-game-preview-actions { left: 6px; bottom: 6px; gap: 4px; }
  .in-game-preview-control { width: 31px; height: 31px; border-radius: 8px; font-size: 1rem; }
  .edge-only-toggle { left: 58px; bottom: calc(var(--board-gutter) + 6px); width: 40px; height: 40px; padding: 4px; border-radius: 10px; }
  .hint-button { left: 12px; bottom: calc(var(--board-gutter) + 6px); width: 40px; height: 40px; padding: 6px; border-radius: 10px; }
  .group-shuffle-button { left: 104px; bottom: calc(var(--board-gutter) + 6px); width: 40px; height: 40px; padding: 6px; border-radius: 10px; }
  .board-status-controls { right: 12px; bottom: calc(var(--board-gutter) + 6px); gap: 6px; }
  .board-timer { min-height: 40px; gap: 6px; padding: 4px 10px 4px 4px; }
  .pause-timer-button { width: 32px; height: 32px; padding: 7px; }
  .board-timer-value strong { font-size: .82rem; }
  .board-wrap.fullscreen-active { --board-gutter: 0px; --board-rail-height: 52px; padding: 0 0 var(--board-rail-height); border-radius: 0; }
  .board-wrap.fullscreen-active .board { border-radius: 0; }
  .board-wrap.fullscreen-active .in-game-preview { top: 0; right: 0; }
  .fullscreen-menu { top: max(9px, env(safe-area-inset-top)); left: max(9px, env(safe-area-inset-left)); }
  .fullscreen-menu-trigger { min-height: 38px; padding-inline: 12px; }
  .fullscreen-toggle-button { width: 38px; height: 38px; }
  .fullscreen-menu-panel { width: 205px; padding: 12px; }
  .puzzle-launcher { inset: 6px; }
  .launcher-trigger { left: 10px; bottom: 10px; min-height: 44px; padding: 5px 11px 5px 6px; }
  .launcher-trigger-icon { width: 32px; height: 32px; }
  .launcher-trigger small { display: none; }
  .cut-panel { right: 7px; width: calc(100% - 14px); max-height: calc(100% - 14px); grid-template-columns: minmax(116px, .8fr) minmax(0, 1.2fr); border-radius: 13px; }
  .cut-panel-close { top: 4px; right: 4px; width: 25px; height: 25px; }
  .cut-type-menu, .piece-submenu { padding: 10px; }
  .cut-type-option { min-height: 45px; padding: 5px 7px; }
  .cut-type-option small, .piece-submenu-note { display: none; }
  .piece-submenu-heading { align-items: start; flex-direction: column; gap: 2px; margin-bottom: 7px; }
  .piece-count-grid { gap: 4px; }
  .piece-count-grid button { min-height: 32px; border-radius: 7px; font-size: .72rem; }
  :root.home-page .home-daily-card { min-height: 205px; border-radius: 0; }
  .home-daily-selection { right: 6px; width: calc(100% - 12px); max-height: calc(100% - 12px); grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); border-radius: 12px; }
  .home-daily-start { left: 10px; bottom: 10px; min-height: 42px; padding: 5px 10px 5px 6px; }
  .home-daily-start > span { width: 30px; height: 30px; }
  .success { padding: 20px 14px; }
  .completion-heading h2 { font-size: clamp(1.55rem, 7vw, 2.5rem); }
  .completion-heading p:last-child { margin-top: 6px; }
  .completion-actions { gap: 7px; }
  .completion-action { min-height: 40px; padding: 0 12px; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Page de bibliothèque par catégorie */
.category-home-link { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--panel); font-size: .82rem; font-weight: 750; text-decoration: none; }
.category-home-link:hover { border-color: var(--teal); }
.category-page-shell { width: min(1520px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 64px) 72px; }
.category-location-trail { margin-bottom: clamp(26px, 5vw, 54px); }
.category-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.category-hero > div { max-width: 780px; }
.category-hero h1 { font-size: clamp(1.75rem, 3.2vw, 3rem); }
.category-hero > div > p:last-child { max-width: 640px; margin: 16px 0 0; color: var(--muted); font-family: Georgia, "Noto Serif", serif; font-size: clamp(.98rem, 1.6vw, 1.18rem); line-height: 1.6; }
.category-total { flex: 0 0 auto; display: grid; justify-items: end; gap: 2px; margin: 0; }
.category-total strong { color: var(--teal); font: 600 clamp(2.2rem, 5vw, 4rem) Georgia, serif; line-height: .9; }
.category-total span { color: var(--muted); font-size: .72rem; }
.category-content-layout { display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); align-items: start; gap: clamp(28px, 4vw, 56px); margin-top: 22px; }
.category-library { min-width: 0; }
.category-page-nav { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
.category-page-nav::-webkit-scrollbar { display: none; }
.category-page-tab { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 0 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--panel); text-decoration: none; }
.category-page-tab strong { font-size: .78rem; }
.category-page-tab span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--panel-soft); font-size: .66rem; font-weight: 800; }
.category-page-tab:hover { border-color: var(--teal); }
.category-page-tab[aria-current="page"] { border-color: var(--teal-deep); color: var(--panel); background: var(--teal-deep); }
.category-page-tab[aria-current="page"] span { color: var(--accent-text); background: var(--accent); }
.category-grid-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.category-grid-heading h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.category-grid-heading p { margin: 0; color: var(--muted); font-size: .78rem; }
.category-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
.library-puzzle-card { min-width: 0; display: block; color: var(--ink); text-decoration: none; }
.library-image-frame { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 0; background: var(--panel-soft); box-shadow: 0 12px 34px var(--soft-shadow); }
.library-image-frame img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .28s ease; }
.library-piece-range { position: absolute; left: 10px; bottom: 10px; padding: 7px 10px; border-radius: 999px; color: #fff; background: rgba(13, 31, 27, .82); backdrop-filter: blur(10px); font-size: .64rem; font-weight: 800; }
.library-puzzle-card h2 { margin: 13px 3px 0; font: 600 clamp(1.05rem, 2vw, 1.28rem) Georgia, "Noto Serif", serif; line-height: 1.2; }
.library-puzzle-card p { margin: 5px 3px 0; color: var(--muted); font-size: .74rem; }
.library-puzzle-card:hover .library-image-frame, .library-puzzle-card:focus-visible .library-image-frame { border-color: var(--teal); box-shadow: 0 18px 42px var(--soft-shadow); }
.library-puzzle-card:hover img, .library-puzzle-card:focus-visible img { transform: scale(1.025); }
.library-puzzle-card:focus-visible { outline: 0; }
.category-page-empty { grid-column: 1 / -1; min-height: 280px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 34px; border: 1px dashed var(--line); border-radius: 22px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.category-page-empty > span { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; color: var(--teal); background: var(--panel-soft); font-size: 1.45rem; }
.category-page-empty h2 { font-size: 1.3rem; }
.category-page-empty p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .category-content-layout { display: block; }
  .category-page-nav { flex-direction: row; overflow-x: auto; margin: 0 0 34px; padding: 2px 1px 9px; scrollbar-width: none; }
  .category-page-tab { width: auto; flex: 0 0 auto; justify-content: flex-start; }
}

@media (max-width: 650px) {
  .category-home-link { padding-inline: 11px; font-size: .75rem; }
  .category-location-trail { margin-bottom: 28px; }
  .category-hero { display: grid; gap: 20px; }
  .category-total { justify-items: start; }
  .category-grid-heading { display: grid; gap: 7px; }
  .category-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .library-image-frame { border-radius: 0; }
  .library-piece-range { left: 7px; bottom: 7px; padding: 5px 7px; font-size: .56rem; }
  .library-puzzle-card h2 { margin-top: 9px; font-size: .95rem; }
  .library-puzzle-card p { font-size: .65rem; }
  .category-page-empty { min-height: 220px; padding: 24px 18px; }
}

/* Création de profil */
:root.profile-page body { overflow-x: hidden; }
.profile-home-link { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--panel); font-size: .8rem; font-weight: 750; text-decoration: none; }
.profile-home-link:hover, .profile-home-link:focus-visible { border-color: var(--teal); outline: 0; }
.profile-main { width: min(1150px, 100%); min-height: calc(100vh - 142px); margin: 0 auto; padding: clamp(28px, 6vw, 74px) clamp(16px, 5vw, 52px); }
.profile-intro h1 { max-width: 500px; font-size: clamp(2.6rem, 5vw, 5rem); line-height: .98; }
.profile-intro > p:not(.eyebrow) { max-width: 46ch; margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.profile-intro #profileNickname { color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.profile-intro button { margin-top: 12px; padding-inline: 14px; }
.profile-history { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; margin-top: 24px; align-items: start; }
.profile-history section { padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.profile-history h2 { margin-bottom: 12px; }
.profile-history ul { margin: 0; padding: 0; list-style: none; }
.profile-history li { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.profile-history li:last-child { padding-bottom: 0; }
.profile-history .profile-history-result { grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 12px; }
.profile-history-result img { display: block; width: 80px; height: 45px; border-radius: 6px; background: var(--panel-soft); object-fit: cover; }
.profile-history-result div { display: grid; gap: 4px; overflow-wrap: anywhere; }
.profile-history li span, .profile-history section p { color: var(--muted); font-size: .9rem; }
.profile-history li a { display: inline-flex; align-items: center; justify-self: start; min-height: 40px; color: var(--teal); font-weight: 750; }
.home-resume { display: none; text-align: center; }
:root.home-page .home-resume:has(a:not([hidden])) { display: block; margin-top: 12px; }
.home-resume .profile-link { padding-inline: 16px; border: 1px solid var(--line); background: var(--panel); }
.puzzle-share { display: grid; justify-items: start; gap: 18px; width: min(100% - 32px, 760px); margin: 40px auto; }
.puzzle-share img { display: block; width: 100%; height: auto; border-radius: 12px; }

@media (max-width: 620px) {
  .board-wrap.game-active { --board-rail-height: 102px; }
  .board-zoom-controls { left: calc(var(--board-gutter) + 6px); bottom: calc(var(--board-gutter) + 53px); transform: none; }
}

.profile-dialog { width: min(94vw, 650px); max-height: min(92vh, 840px); padding: clamp(24px, 4vw, 40px); overflow: auto; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 26px; background: var(--panel); box-shadow: 0 35px 120px rgba(8, 29, 23, .34); }
.profile-dialog::backdrop { background: rgba(10, 25, 21, .58); backdrop-filter: blur(8px); }
.registration-heading { display: flex; align-items: center; gap: 15px; }
.registration-heading .eyebrow { margin-bottom: 4px; }
.registration-heading h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.registration-mark { width: 48px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px 15px 20px 15px; color: var(--accent); background: var(--teal-deep); font: 700 1.4rem Georgia, serif; transform: rotate(-3deg); }
:root[data-theme="dark"] .registration-mark { color: var(--accent-text); background: var(--accent); }
.registration-intro { margin: 16px 0 26px; color: var(--muted); font: 1rem/1.55 Georgia, "Noto Serif", serif; }
.profile-dialog form { display: grid; gap: 18px; }
.registration-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.registration-field { display: grid; gap: 7px; }
.registration-field label { color: var(--ink); font-size: .77rem; font-weight: 800; }
.registration-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--button-surface); font: inherit; font-size: .88rem; outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; right: 7px; top: 50%; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); transition: color .18s ease, background .18s ease; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--teal); background: var(--panel-soft); outline: 0; }
.password-toggle:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 22%, transparent); }
.password-eye { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .password-eye-open { display: none; }
.password-toggle[aria-pressed="true"] .password-eye-closed { display: block; }
.registration-field input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.registration-field input:hover { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }
.registration-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 15%, transparent); }
.registration-field input:user-invalid { border-color: #b14f48; }
.registration-field small { color: var(--muted); font-size: .66rem; }
.registration-error { margin: -7px 0 0; color: #b14f48; font-size: .72rem; font-weight: 700; }
.registration-notice { margin: 0; padding: 11px 13px; border-radius: 11px; color: var(--muted); background: var(--panel-soft); font-size: .67rem; line-height: 1.45; }
.registration-status { min-height: 18px; margin: -6px 0; color: var(--teal); font-size: .75rem; font-weight: 750; }
.registration-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 2px; }
.registration-actions button { min-height: 46px; padding: 0 20px; border-radius: 999px; cursor: pointer; font-weight: 800; }
.registration-submit { order: 2; border: 1px solid var(--teal-deep); color: var(--panel); background: var(--teal-deep); }
.registration-submit:hover, .registration-submit:focus-visible { border-color: var(--teal); background: var(--teal); outline: 0; }
.registration-submit:disabled { opacity: .6; cursor: wait; }
.registration-cancel { order: 1; border: 1px solid var(--line); color: var(--ink); background: transparent; }
.registration-cancel:hover, .registration-cancel:focus-visible { border-color: var(--teal); outline: 0; }

@media (max-width: 760px) {
  .profile-home-link { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .profile-home-link > span:last-child { display: none; }
  .profile-home-link > span[aria-hidden="true"] { font-size: 1rem; }
  .profile-main { min-height: calc(100vh - 124px); }
  .profile-intro { width: min(100%, 520px); }
  .profile-intro h1 { font-size: clamp(2.25rem, 12vw, 4rem); }
  .profile-dialog { padding: 24px 20px; border-radius: 20px; }
  .registration-fields-row { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .profile-dialog { width: calc(100vw - 18px); max-height: calc(100dvh - 18px); padding: 20px 16px; }
  .registration-mark { width: 42px; }
  .registration-heading { align-items: flex-start; }
  .registration-heading h2 { font-size: 1.35rem; }
  .registration-intro { margin-block: 12px 20px; font-size: .9rem; }
  .profile-dialog form { gap: 14px; }
  .registration-field input { min-height: 47px; }
  .registration-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .registration-actions button { width: 100%; padding-inline: 12px; }
}

/* Feedback */
:root.feedback-page body { overflow-x: hidden; }
.feedback-main { position: relative; width: min(1180px, 100%); margin: 0 auto; padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 42px) clamp(58px, 8vw, 100px); display: grid; grid-template-columns: minmax(260px, .78fr) minmax(420px, 1.22fr); gap: clamp(38px, 7vw, 92px); align-items: center; }
.feedback-copy { position: relative; z-index: 1; }
.feedback-copy h1 { max-width: 520px; font-size: clamp(2.65rem, 5.8vw, 5.5rem); line-height: .96; }
.feedback-lead { max-width: 480px; margin: 24px 0 0; color: var(--muted); font: clamp(1rem, 1.5vw, 1.16rem)/1.65 Georgia, "Noto Serif", serif; }
.feedback-contact-card { margin-top: 34px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--panel) 82%, transparent); box-shadow: 0 16px 42px var(--soft-shadow); }
.feedback-contact-card strong { display: block; margin-bottom: 6px; font-size: .86rem; }
.feedback-contact-card p { margin: 0 0 13px; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.feedback-contact-card a { color: var(--teal); font-size: .82rem; font-weight: 800; text-decoration: none; }
.feedback-contact-card a:hover, .feedback-contact-card a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.feedback-card { position: relative; z-index: 1; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 26px; background: var(--panel); box-shadow: 0 28px 80px rgba(8, 29, 23, .14); }
.feedback-card-heading { margin-bottom: 28px; }
.feedback-card-heading h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
.feedback-card-heading p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.feedback-form { display: grid; gap: 18px; }
.feedback-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feedback-field { display: grid; gap: 7px; }
.feedback-field label { font-size: .77rem; font-weight: 800; }
.feedback-field input, .feedback-field textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--button-surface); font: inherit; font-size: .88rem; outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.feedback-field input { min-height: 50px; }
.feedback-field textarea { min-height: 170px; resize: vertical; line-height: 1.55; }
.feedback-field input::placeholder, .feedback-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.feedback-field input:hover, .feedback-field textarea:hover { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }
.feedback-field input:focus, .feedback-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 15%, transparent); }
.feedback-field input:user-invalid, .feedback-field textarea:user-invalid { border-color: #b14f48; }
.feedback-form-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.feedback-privacy { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.feedback-submit { min-height: 48px; padding: 0 22px; border: 1px solid var(--teal-deep); border-radius: 999px; color: var(--panel); background: var(--teal-deep); cursor: pointer; font-weight: 850; }
.feedback-submit:hover, .feedback-submit:focus-visible { border-color: var(--teal); background: var(--teal); outline: 0; }
.feedback-status { min-height: 18px; margin: 0; color: var(--teal); font-size: .75rem; font-weight: 750; }
.feedback-piece { position: absolute; z-index: 0; width: 170px; aspect-ratio: 1; left: -40px; bottom: 2%; border: 1px solid color-mix(in srgb, var(--teal) 18%, transparent); border-radius: 28%; background: color-mix(in srgb, var(--teal) 7%, transparent); transform: rotate(-16deg); }
.feedback-piece::before { position: absolute; content: ""; width: 34%; aspect-ratio: 1; right: -17%; top: 33%; border-radius: 50%; background: var(--paper); }

@media (max-width: 820px) {
  .feedback-main { grid-template-columns: 1fr; gap: 34px; align-items: start; }
  .feedback-copy { max-width: 650px; }
  .feedback-copy h1 { font-size: clamp(2.4rem, 10vw, 4.5rem); }
  .feedback-contact-card { max-width: 520px; }
  .feedback-piece { display: none; }
}

@media (max-width: 540px) {
  .feedback-main { padding-top: 32px; }
  .feedback-card { padding: 22px 17px; border-radius: 20px; }
  .feedback-fields-row { grid-template-columns: 1fr; }
  .feedback-form-footer { grid-template-columns: 1fr; }
  .feedback-submit { width: 100%; }
}
