:root {
      color-scheme: dark;
      --bg: #0d0d11; --card: #18191f; --card2: #1f2028; --line: #34343d;
      --ink: #f4f1f0; --muted: #aaa8ae; --accent: #ef5965; --deepred: #961d2e;
      --green: #7fe0b1; --shadow: 0 20px 65px #0008;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-height: 100vh; color: var(--ink); background:
      radial-gradient(ellipse 65vw 50vw at 95% -10%, #54142166, transparent 72%),
      radial-gradient(ellipse 45vw 38vw at 0% 80%, #22212b77, transparent 80%), var(--bg); }
    button, input, select { font: inherit; }
    button { cursor: pointer; }
    button:disabled { opacity: .45; cursor: not-allowed; }
    button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #ff9aa2; outline-offset: 3px; }
    .shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 70px; }
    .top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
    .brand { display: flex; align-items: center; gap: 13px; font-size: 12px; letter-spacing: .17em; text-transform: uppercase; font-weight: 850; }
    .brand-logo { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid #cf4b58aa; border-radius: 12px; color: #ff8a91; background: #b9364d20; font-size: 23px; }
    .status-tag { border: 1px solid #544048; background: #331e29; color: #ffa7ae; padding: 8px 11px; border-radius: 999px; font-size: 12px; letter-spacing: .03em; }
    .hero { margin: 14px 0 28px; max-width: 900px; }
    .overline { color: #ff8994; font-weight: 750; font-size: 12px; letter-spacing: .21em; text-transform: uppercase; }
    h1 { margin: 10px 0 9px; font-size: clamp(36px, 5.5vw, 64px); line-height: 1.05; letter-spacing: -.05em; }
    .hero p { margin: 0; color: var(--muted); line-height: 1.65; max-width: 670px; font-size: 15px; }
    .settings { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 23px; }
    .setting-label { color: #c8c4c9; font-size: 13px; margin-right: 3px; }
    .choose { min-width: 180px; padding: 11px 39px 11px 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
    .button { border: 1px solid #4a3a41; background: #2b242b; color: #fff1f2; padding: 11px 16px; border-radius: 12px; font-weight: 700; transition: background .15s, transform .1s; }
    .button:hover:not(:disabled) { background: #49313b; }
    .button:active:not(:disabled) { transform: translateY(1px); }
    .button.primary { border-color: #ed6674; background: linear-gradient(135deg,#dd4356,#a5293c); box-shadow: 0 8px 30px #e33a551d; }
    .button.primary:hover:not(:disabled) { background: linear-gradient(135deg,#f25a6c,#b92f45); }
    .button.subtle { background: #202027; border-color: #3d3d47; color: #e7e2e4; }
    .grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .85fr); gap: 20px; align-items: start; }
    .panel { border: 1px solid var(--line); background: linear-gradient(154deg, #212129, #17171d 74%); box-shadow: var(--shadow); border-radius: 22px; overflow: hidden; }
    .panel-head { padding: 23px 24px 19px; border-bottom: 1px solid #34343b; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
    h2 { font-size: 19px; margin: 0; letter-spacing: -.02em; }
    .head-note { color: var(--muted); font-size: 12px; }
    .clue-guide { padding: 16px 24px; background: #212028; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: #bbb8c0; }
    .clue-guide strong { color: #eee6e8; }
    .clue-guide .mini { display: inline-block; min-width: 19px; text-align: center; border: 1px solid #65525a; border-radius: 5px; color: #ffd3d8; margin: 0 3px; }
    .clue-scroll { overflow-x: auto; }
    .clue-table { width: 100%; border-collapse: collapse; min-width: 365px; }
    .clue-table th { font-size: 11px; color: #a6a3aa; letter-spacing: .09em; font-weight: 750; text-transform: uppercase; text-align: left; padding: 15px 12px; background: #14151a; white-space: nowrap; }
    .clue-table th:first-child, .clue-table td:first-child { padding-left: 24px; }
    .clue-table th:last-child, .clue-table td:last-child { padding-right: 24px; }
    .clue-table td { padding: 12px; border-top: 1px solid #2d2e35; }
    .clue-table tr:hover td { background: #ffffff05; }
    .numbercode { display: inline-flex; gap: 4px; vertical-align: middle; white-space: nowrap; }
    .numbercode span { background: #30303a; border: 1px solid #4a4650; border-radius: 7px; color: #f4f1f0; width: 30px; height: 37px; display: inline-grid; place-items: center; font-weight: 780; font-variant-numeric: tabular-nums; }
    .value { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 9px; font-weight: 800; font-variant-numeric: tabular-nums; }
    .value.exact { color: #b4f6d2; background: #214133; border: 1px solid #3f7456; }
    .value.shift { color: #ffd3a5; background: #483526; border: 1px solid #745535; }
    .panel-foot { padding: 15px 24px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
    .unique-indicator { width: 8px; height: 8px; border-radius: 100%; background: #8ce6af; box-shadow: 0 0 10px #70e3a95a; }
    .vault { text-align: center; position: relative; padding: 25px 24px 22px; }
    .vault-inner { position: relative; width: 170px; height: 170px; margin: 0 auto 18px; display: grid; place-items: center;
      border-radius: 50%; background: radial-gradient(circle, #1e1c24 0 29%, #37363c 30% 38%, #17171c 40% 58%, #343039 60% 66%, #0f1016 68%);
      border: 3px solid #4d4650; box-shadow: 0 0 0 8px #121219, 0 0 0 9px #41343a, 0 15px 42px #0009, inset 0 0 25px #0009; }
    .vault-inner svg { width: 70px; height: 70px; stroke: #e87883; filter: drop-shadow(0 2px 13px #d8445040); transition: stroke .25s, transform .35s; }
    .vault-inner.open svg { stroke: #9be2ba; transform: rotate(-13deg); }
    .vault-title { font-size: 19px; font-weight: 800; margin: 8px 0 5px; }
    .vault-sub { color: var(--muted); font-size: 13px; line-height: 1.5; min-height: 20px; }
    .input-area { margin-top: 18px; }
    .code-entry { border: 1px solid #6d3d49; outline: none; background: #0d0e13; border-radius: 14px; padding: 15px 10px; width: 100%; text-align: center; color: #fff; font: 750 clamp(24px, 5vw, 34px)/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .20em; caret-color: #f86c7a; box-shadow: inset 0 2px 8px #0007; font-variant-numeric: tabular-nums; }
    .code-entry::placeholder { color: #4d4652; }
    .code-entry:focus { border-color: #fa7382; box-shadow: 0 0 0 3px #e44f6323, inset 0 2px 8px #0007; }
    .code-entry:disabled { color: #d4c9cc; opacity: .7; }
    .error { min-height: 21px; text-align: center; color: #ff909c; font-size: 12px; margin: 8px 0 3px; }
    .keypad { max-width: 290px; margin: 12px auto 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .key { height: 48px; background: #272730; color: #f5f1f1; border: 1px solid #42404a; border-radius: 11px; font-size: 19px; font-weight: 750; }
    .key:hover:not(:disabled) { background: #41404b; }
    .key.alt { font-size: 14px; color: #ffb8bf; }
    .submit { width: min(290px,100%); padding: 15px 12px; }
    .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 19px; }
    .actions .button { font-size: 12px; padding: 10px 12px; }
    .result { border: 1px solid #46424a; background: #171820; border-radius: 13px; padding: 12px; font-size: 13px; line-height: 1.5; margin-top: 15px; color: #e8e5e7; display: none; }
    .result.show { display: block; }
    .result.win { border-color: #44815c; background: #203528; }
    .result.lose { border-color: #854457; background: #39232b; }
    .under-panels { margin-top: 20px; display: grid; grid-template-columns: 1.2fr .85fr; gap: 20px; }
    .mini-panel { background: #191920; border: 1px solid #34343e; padding: 20px 24px; border-radius: 18px; }
    .mini-panel h2 { font-size: 16px; margin-bottom: 12px; }
    .attempts { display: flex; flex-direction: column; gap: 9px; min-height: 38px; }
    .attempt { display: flex; align-items: center; justify-content: space-between; gap: 9px; border: 1px solid #32313a; border-radius: 9px; background: #22222a; padding: 8px 11px; font-size: 12px; }
    .attempt strong { font-family: ui-monospace,monospace; font-size: 16px; letter-spacing: .09em; }
    .attempt .detail { color: #bdb8bd; text-align: right; }
    .empty { color: #a49ea5; font-size: 13px; line-height: 1.5; }
    .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .stat { background: #23222b; border: 1px solid #3b3840; text-align: center; padding: 13px 6px; border-radius: 12px; }
    .stat strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; }
    .stat span { display: block; font-size: 11px; color: #bbb5bd; margin-top: 4px; }
    details { margin-top: 16px; border-top: 1px solid #37343c; padding-top: 14px; }
    details summary { cursor: pointer; font-size: 13px; font-weight: 700; }
    details p, details li { font-size: 12px; line-height: 1.65; color: #bbb5be; }
    details ul { padding-left: 18px; }
    .footer { margin-top: 25px; text-align: center; color: #86828a; font-size: 12px; line-height: 1.6; }
    .toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: #e7dddF; border: 1px solid #fff; color: #17151a; font-size: 13px; font-weight: 650; padding: 12px 18px; border-radius: 11px; box-shadow: 0 16px 44px #0008; opacity: 0; transition: transform .18s, opacity .18s; pointer-events: none; z-index: 9; }
    .toast.visible { opacity: 1; transform: translate(-50%,0); }
    .share-panel { margin-top: 18px; padding: 17px 19px; border-radius: 17px; border: 1px solid #533742; background: linear-gradient(110deg, #2a1921, #1b1b23 72%); }
    .share-panel h2 { font-size: 15px; margin: 0 0 7px; }
    .share-info { color: #c6b9c0; font-size: 12px; line-height: 1.6; margin: 0 0 12px; }
    .share-flex { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; }
    .share-code-block { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; flex: 1; }
    .shared-code { font: 750 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; background: #110f15; color: #ffb2bc; border: 1px solid #744150; border-radius: 10px; padding: 10px 12px; user-select: all; }
    .share-load { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
    .share-input { font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: #fff; background: #101016; border: 1px solid #54444f; border-radius: 10px; padding: 11px 12px; min-width: 158px; max-width: 220px; width: 100%; }
    .share-note { color: #a8a0a8; font-size: 12px; line-height: 1.5; margin: 12px 0 0; }
    .share-error { color: #ff98a3; min-height: 17px; font-size: 12px; margin-top: 8px; }
    @media (max-width: 900px) { .grid, .under-panels { grid-template-columns: 1fr; } .vault { padding-top: 26px; } }
    @media (max-width: 480px) { .shell { width: min(100% - 22px, 1240px); padding-top: 16px; } .panel-head, .clue-guide { padding-left: 15px; padding-right: 15px; } .clue-table th:first-child,.clue-table td:first-child { padding-left: 15px; } .clue-table th:last-child,.clue-table td:last-child { padding-right: 15px; } .clue-table th,.clue-table td { padding-left: 6px; padding-right: 6px; } .numbercode span { width: 26px; height: 34px; } .hero p { font-size: 14px; } .settings { align-items: stretch; } .choose { flex: 1; } .button.primary { white-space: nowrap; } }
    @media (max-width: 540px) {
      /* Stack each clue so every response remains readable on a narrow phone. */
      .clue-table { min-width: 0; width: 100%; }
      .clue-table thead { display: none; }
      .clue-table tbody tr { display: grid; grid-template-columns: 32px minmax(0,1fr) minmax(0,1fr); grid-template-rows: 41px 38px; align-items: center; column-gap: 9px; padding: 10px 13px; border-top: 1px solid #32313a; }
      .clue-table td { padding: 0 !important; border: none; min-width: 0; }
      .clue-table td:nth-child(1) { grid-row: 1 / 3; grid-column: 1; align-self: center; }
      .clue-table td:nth-child(2) { grid-row: 1; grid-column: 2 / 4; }
      .clue-table td:nth-child(3) { grid-row: 2; grid-column: 2; }
      .clue-table td:nth-child(4) { grid-row: 2; grid-column: 3; }
      .clue-table td:nth-child(3), .clue-table td:nth-child(4) { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
      .clue-table td:nth-child(3)::before { content: "● Platz"; font-size: 11px; color: #b7aeb4; }
      .clue-table td:nth-child(4)::before { content: "○ Falsch"; font-size: 11px; color: #b7aeb4; }
      .clue-table .numbercode span { width: 28px; height: 34px; }
      .clue-table .value { width: 29px; height: 29px; }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Isolated Grav game page: no shared Quark/NSD CSS is loaded. */
.site-return { color: #decbd0; font-weight: 700; font-size: 13px; text-decoration: none; margin-left: auto; }
.site-return:hover, .site-return:focus-visible { color: #fff; text-decoration: underline; }
@media (max-width: 620px) { .site-return { margin-left: 0; } }

/* Tresor V2: scoreboard and server timer, scoped to isolated page */
[hidden] { display: none !important; }
.mode-tag { display:inline-block; padding:6px 10px; border:1px solid #4d3840; border-radius:12px; background:#221820; color:#f4b9c5; font-size:12px; margin-bottom:12px; }
.clock-panel { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:9px 16px 16px; margin:0 auto 14px; max-width:250px; border:1px solid #58323d; border-radius:12px; background:linear-gradient(160deg,#1a1820,#2c1820); }
.clock-panel strong { font-family:ui-monospace,monospace; color:#fbe6e7; font-size:clamp(28px,5vw,42px); letter-spacing:.08em; font-variant-numeric:tabular-nums; }
.clock-panel span { color:#cbb8bf; font-size:11px; }
.leaderboard-section { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:18px; }
.leaderboard-section .mini-panel { min-width:0; }
.score-card { grid-column:auto; }
.score-note { color:#c1b8bf; font-size:12px; line-height:1.6; }
.score-submit { display:flex; flex-direction:column; gap:10px; margin-top:9px; }
.score-submit input { background:#101016; border:1px solid #60515b; border-radius:10px; color:#fff; padding:12px; font-size:16px; min-width:0; width:100%; }
.score-feedback { color:#f6bbc3; margin-top:8px; font-size:13px; min-height:16px; }
.leaders { display:flex; flex-direction:column; gap:7px; font-size:12px; line-height:1.5; color:#c8c1c8; }
.leader-row { border-bottom:1px solid #36333b; padding:7px 0; display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:5px; }
.leader-rank { color:#eda0ab; } .leader-name { overflow-wrap:anywhere; min-width:0; } .leader-row strong { font-family:ui-monospace,monospace; color:#fff; font-size:14px; }
@media(max-width:900px){ .leaderboard-section{grid-template-columns:repeat(2,minmax(0,1fr));}.score-card{grid-column:span 2;} }
@media(max-width:570px){ .leaderboard-section{grid-template-columns:1fr;} .score-card{grid-column:auto;} }


/* =======================================================================
 * Tresor 09 · Design Polish V1 (2026-11-14)
 * Presentation only. JS/API/SQLite contracts and IDs remain untouched.
 * Priorities: legibility at 100% zoom, gameplay-first hierarchy, touch UX.
 * ======================================================================= */
:root {
  --bg: #0b0c10;
  --card: #191a21;
  --card2: #20222b;
  --line: #3b3b47;
  --ink: #f5f3f5;
  --muted: #c5c0c9;
  --accent: #f16a79;
  --shadow: 0 18px 44px rgba(0,0,0,.24);
}
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse 43vw 31vw at 95% 0%, rgba(119, 30, 53, .17), transparent 80%),
    radial-gradient(ellipse 50vw 43vw at 1% 80%, rgba(51, 49, 75, .1), transparent 78%),
    var(--bg);
}
.shell { width: min(1160px, calc(100% - 48px)); padding: 24px 0 56px; }
.top { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid #292a33; gap: 16px; }
.brand { font-size: 12px; letter-spacing: .13em; gap: 11px; }
.brand-logo { width: 35px; height: 35px; border-radius: 11px; }
.brand-divider { color: #918b97; }
.status-tag { font-size: 12px; padding: 7px 12px; color: #ffb9c2; }
.site-return { color: #d2ccd4; font-size: 13px; }
.hero { max-width: none; margin: 0 0 22px; }
.overline { font-size: 12px; letter-spacing: .17em; }
h1 { font-size: clamp(32px, 4.5vw, 52px); line-height: 1.09; margin: 9px 0 8px; letter-spacing: -.045em; }
.accent-text { color: #fa7a8a; }
.hero > p { max-width: 970px; font-size: 15px; line-height: 1.56; color: #cbc5cf; }
.mode-tag { margin: 0 0 0 auto; font-size: 12px; border-radius: 999px; padding: 7px 12px; background: #241b26; border-color: #64434e; }
.settings { margin-top: 14px; gap: 11px; }
.setting-label { font-size: 13px; color: #d2cbd4; }
.choose, .button { min-height: 46px; border-radius: 11px; font-size: 14px; }
.choose { padding: 10px 35px 10px 14px; }
.button { padding: 11px 17px; }
.button.primary { background: linear-gradient(135deg, #eb596e, #b9384e); border-color: #ff8a9b; box-shadow: 0 6px 25px rgba(183,46,71,.13); }
.button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #fc6e83, #d3445b); }
.button.subtle { background: #252630; border-color: #464754; color: #f4eff4; }
.grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.panel { border-radius: 19px; background: linear-gradient(145deg, #1e2028, #17181e 75%); border-color: #3a3c49; box-shadow: var(--shadow); }
.panel-head { padding: 19px 21px 17px; }
h2 { font-size: 20px; line-height: 1.3; }
.head-note { color: #c4bec9; margin-top: 4px; font-size: 13px; }
.clue-guide { padding: 13px 21px; color: #ccc5ce; background: #24242e; font-size: 13px; line-height: 1.65; }
.clue-guide strong { color: #f5edf1; }
.clue-guide .mini { border-color: #806473; color: #f5bec7; }
.clue-table { min-width: 410px; }
.clue-table th { font-size: 11px; padding: 12px 9px; background: #15171d; color: #d0cad3; letter-spacing: .045em; }
.clue-table td { padding: 10px 9px; border-color: #34353e; }
.clue-table th:first-child, .clue-table td:first-child { padding-left: 21px; }
.clue-table th:last-child, .clue-table td:last-child { padding-right: 21px; }
.numbercode { gap: 5px; }
.numbercode span { width: 32px; height: 38px; font-size: 17px; border-radius: 8px; background: #30323e; border-color: #545363; }
.value { width: 34px; height: 34px; font-size: 16px; }
.value.exact { color: #cdfce1; background: #214734; border-color: #538668; }
.value.shift { color: #ffe2b5; background: #4e3925; border-color: #8b643d; }
.panel-foot { padding: 14px 21px; font-size: 12px; color: #c5bfc6; }
/* Keep the lock and the digital stopwatch in one horizontal status bar. */
.vault { display: grid; grid-template-columns: 118px minmax(0,1fr); column-gap: 19px; align-items: center; padding: 24px 25px 25px; text-align: center; }
.vault > * { min-width: 0; grid-column: 1 / -1; }
.vault-inner { grid-column: 1; width: 105px; height: 105px; margin: 0 auto; border: 2px solid #55515b; box-shadow: 0 0 0 5px #15161c, 0 0 0 6px #4c3943, 0 12px 26px #0007, inset 0 0 18px #0008; }
.vault-inner svg { width: 45px; height: 45px; }
.clock-panel { grid-column: 2; max-width: none; width: 100%; min-height: 110px; margin: 0; padding: 13px 16px; background: linear-gradient(145deg, #30202d, #211c28); border: 1px solid #6e4356; border-radius: 14px; }
.clock-panel .setting-label { font-size: 12px; color: #f0d5db; margin: 0; }
.clock-panel strong { line-height: 1.22; font-size: clamp(31px, 3.1vw, 44px); color: #fff4f5; letter-spacing: .06em; }
.clock-panel span { font-size: 12px; color: #d6c6cc; }
.vault-title { margin: 15px 0 3px; font-size: 22px; }
.vault-sub { font-size: 14px; color: #cec8d1; min-height: 0; }
.input-area { margin-top: 14px; }
.input-area .setting-label { display: block; margin-bottom: 8px; font-size: 13px; }
.code-entry { min-height: 65px; border-radius: 12px; border-color: #935268; letter-spacing: .15em; background: #101116; font-size: clamp(28px, 3vw, 34px); }
.code-entry::placeholder { color: #66606c; }
.error { margin: 7px 0 3px; min-height: 18px; }
.keypad { max-width: 335px; width: 100%; gap: 8px; margin: 7px auto 13px; }
.key { height: 49px; font-size: 20px; border-radius: 10px; border-color: #51515e; background: #30313b; }
.key:hover:not(:disabled) { background: #434653; border-color: #807985; }
.key.alt { color: #ffbdc8; }
.submit { max-width: 335px; width: 100%; min-height: 52px; font-size: 15px; }
.actions { margin-top: 11px; gap: 10px; }
.actions .button { min-height: 42px; font-size: 13px; padding: 10px 13px; }
/* Secondary information is intentionally beneath the main puzzle. */
.section-heading { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 0; }
.section-eyebrow { display: block; color: #f08c9a; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
.section-heading h2 { font-size: 23px; }
.section-heading p { margin: 0; color: #c9c1ca; font-size: 13px; line-height: 1.5; }
.leaderboard-section { gap: 16px; margin-top: 22px; }
.mini-panel { border-radius: 16px; padding: 21px 22px; border-color: #3c3c47; background: #1b1b23; }
.mini-panel h2 { font-size: 17px; margin-bottom: 12px; }
.score-note, .leaders { font-size: 13px; color: #c9c2cd; }
.leader-row { padding: 10px 0; }
.leader-row strong { font-size: 15px; }
.score-submit input { min-height: 48px; }
.under-panels { margin-top: 17px; gap: 16px; }
.attempt-count { color: #c6c0ca; font-size: 14px; }
.attempt, .empty { font-size: 13px; }
.stat { padding: 14px 7px; }
.stat strong { font-size: 26px; }
.stat span { font-size: 12px; }
/* Sharing is useful, but should not delay access to gameplay. */
.share-panel { margin-top: 19px; padding: 20px 22px; background: linear-gradient(110deg, #251c26, #1d1d25 75%); border-color: #4c3b49; }
.share-panel h2 { font-size: 18px; margin-bottom: 5px; }
.share-info { font-size: 13px; line-height: 1.55; margin-bottom: 13px; color: #cfc3cc; }
.share-flex { align-items: end; gap: 16px; }
.share-code-block { flex: 0 1 380px; }
.shared-code { font-size: 17px; }
.share-load { gap: 8px; }
.share-input { max-width: 260px; min-height: 45px; }
.share-note { color: #c0b7c0; font-size: 12px; }
.footer { color: #aaa3b0; }
@media (max-width: 1000px) {
 .clue-table { min-width: 390px; }
 .clue-table th, .clue-table td { padding-left: 7px; padding-right: 7px; }
 .numbercode span { width: 29px; height: 36px; }
 .vault { grid-template-columns: 101px minmax(0,1fr); column-gap: 14px; padding: 20px; }
 .vault-inner { width: 92px; height: 92px; }
 .clock-panel { min-height: 100px; }
}
@media (max-width: 900px) {
 .grid { grid-template-columns: 1fr; }
 .vault { grid-template-columns: 125px minmax(0,1fr); }
 .vault-inner { width: 112px; height: 112px; }
 .clock-panel { min-height: 112px; }
 .clue-table { min-width: 410px; }
}
@media (max-width: 620px) {
 .shell { width: calc(100% - 26px); padding-top: 15px; }
 .top { margin-bottom: 17px; }
 .site-return { margin-left: auto; }
 .top #case-id { width: 100%; text-align: left; font-size: 11px; }
 .brand { font-size: 10px; gap: 7px; letter-spacing: .10em; }
 .brand-logo { width: 32px; height: 32px; }
 .hero { margin-bottom: 17px; }
 h1 { font-size: clamp(30px, 8vw, 40px); }
 .hero > p { font-size: 14px; }
 .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
 .settings .setting-label { grid-column: 1 / -1; }
 .settings .choose { grid-column: 1 / -1; width: 100%; min-width: 0; }
 .settings .button { min-width: 0; padding: 11px 8px; }
 .settings .mode-tag { grid-column: 1 / -1; justify-self: start; margin: 0; }
 .mode-tag { font-size: 11px; }
 .panel-head { padding: 17px 15px; }
 .clue-guide { padding: 12px 15px; }
 .panel-foot { padding: 12px 15px; }
 .vault { grid-template-columns: 98px minmax(0,1fr); padding: 20px 17px 24px; column-gap: 13px; }
 .vault-inner { width: 88px; height: 88px; }
 .vault-inner svg { width: 39px; height: 39px; }
 .clock-panel { min-height: 98px; padding: 11px 9px; }
 .clock-panel strong { font-size: clamp(28px, 8vw, 38px); }
 .clock-panel span { font-size: 11px; }
 .vault-title { font-size: 20px; margin-top: 17px; }
 .keypad { max-width: 340px; }
 .key { height: 55px; }
 .section-heading { flex-direction: column; align-items: flex-start; gap: 5px; }
 .leaderboard-section { grid-template-columns: 1fr; }
 .score-card { grid-column: auto; }
 .mini-panel { padding: 18px; }
 .share-panel { padding: 17px; }
 .share-code-block { flex-basis: auto; }
 .share-load { width: 100%; }
 .share-input { min-width: 0; flex: 1 1 150px; }
}
@media (max-width: 540px) {
 .clue-table { min-width: 0; }
 .clue-table tbody tr { padding: 9px 13px; grid-template-rows: 40px 36px; }
 .clue-table .numbercode span { width: 29px; height: 34px; font-size: 16px; }
 .clue-table .value { width: 28px; height: 28px; font-size: 14px; }
 .clue-table td:nth-child(3)::before, .clue-table td:nth-child(4)::before { font-size: 11px; }
}
@media (max-width: 360px) {
 .vault { grid-template-columns: 76px minmax(0,1fr); gap: 10px; padding: 18px 12px; }
 .vault-inner { width: 72px; height: 72px; }
 .vault-inner svg { width: 34px; height: 34px; }
 .clock-panel { min-height: 90px; }
 .clock-panel strong { font-size: 29px; }
 .clue-table .numbercode span { width: 25px; height: 31px; font-size: 15px; }
 .clue-table tbody tr { column-gap: 5px; padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ====================================================================
  TRESOR 09 / SAFE DOOR V1 · Realistic mechanical safe + LED code panel
  Strictly page-local. Game logic, API and leaderboard structure unchanged.
  ==================================================================== */
:root { --metal:#757b86; --metal-dark:#2e323b; --safety-led:#ff625e; --display-red:#ff5955; }
.shell{width:min(1170px,calc(100% - 42px));padding-top:18px}
.top{margin-bottom:12px;padding-bottom:10px}
.hero{margin:0 0 16px}
.overline{font-size:11px}
h1{font-size:clamp(29px,3vw,40px);margin:3px 0 5px}
.hero>p{font-size:14px;max-width:none}
.settings{margin-top:12px;gap:9px}
.settings .choose,.settings .button{min-height:42px}
.safe-stage{position:relative;isolation:isolate;margin:12px 0 26px}
.safe-frame{position:relative;padding:12px;border:1px solid #69717d;border-radius:18px;
  background:linear-gradient(140deg,#79828e 0%,#474d59 9%,#222833 19%,#464d59 52%,#232935 80%,#858d97 100%);
  box-shadow:0 35px 55px rgba(0,0,0,.5), inset 0 2px 1px #d8e0e980,inset 0 -6px 11px #07090f8c,0 0 0 5px #11141a;}
.safe-frame:before{content:'';position:absolute;inset:5px;pointer-events:none;border:1px solid #c6cad533;border-radius:14px;box-shadow:inset 0 0 0 1px #0009}
.safe-rivet{position:absolute;z-index:3;width:17px;height:17px;border-radius:100%;border:2px solid #1e222b;
  background:radial-gradient(circle at 32% 27%,#dce0e2 0%,#8a909a 22%,#292d35 68%,#14181f 100%);
  box-shadow:0 1px 2px #fff7,inset 0 0 2px #000,0 2px 4px #0009;}
.safe-rivet:after{content:'';position:absolute;top:6px;left:3px;width:7px;height:1px;background:#22252a;transform:rotate(-36deg)}
.rivet-tl{top:7px;left:8px}.rivet-tr{top:7px;right:8px}.rivet-bl{bottom:7px;left:8px}.rivet-br{bottom:7px;right:8px}
.safe-plate{position:relative;overflow:hidden;border-radius:11px;border:1px solid #111821;
  background:repeating-linear-gradient(96deg,#ffffff04 0px,#ffffff04 1px,transparent 1px,transparent 5px),
             linear-gradient(150deg,#383e49 0%,#292f39 47%,#3a414b 58%,#242b36 100%);
  box-shadow:inset 2px 2px 3px #979eac77,inset -6px -8px 10px #0d121bbb;}
.safe-topbar,.safe-footbar{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative;z-index:1}
.safe-topbar{padding:14px 30px 12px;border-bottom:1px solid #131821cc;box-shadow:0 1px #a5b1c52e}
.safe-engraving{display:flex;align-items:center;gap:12px;text-shadow:0 2px 1px #1117}
.safe-engraving-symbol{display:grid;place-items:center;border:1px solid #acb3bb5c;border-radius:50%;width:38px;height:38px;color:#bac2d0;font-size:28px;background:#14192366}
.safe-engraving div{display:flex;flex-direction:column;gap:2px}
.safe-engraving span:not(.safe-engraving-symbol){font-size:20px;line-height:1;letter-spacing:.22em;color:#e0e4eb;font-weight:850}
.safe-engraving b{color:#f18d99}
.safe-engraving small{font-size:9px;letter-spacing:.19em;color:#aeb6c4;font-weight:700}
.safe-lockstate{display:flex;align-items:center;gap:10px;border-radius:6px;border:1px solid #1e252d;background:#151a23a8;padding:8px 13px;color:#e8e6e9;letter-spacing:.08em;font-size:11px;font-weight:850;text-transform:uppercase}
.safe-led{height:10px;width:10px;flex:0 0 auto;border-radius:50%;background:#ff4b4b;box-shadow:0 0 0 3px #ff47421a,0 0 10px #ff4445}
.safe-stage.is-open .safe-led{background:#5ff2aa;box-shadow:0 0 0 3px #43e9982b,0 0 11px #63ffc2}
.safe-stage.is-revealed .safe-led{background:#ffc16a;box-shadow:0 0 9px #ffc16a}
.safe-main{display:grid;grid-template-columns:minmax(250px,.88fr) minmax(0,1.4fr);gap:22px;padding:23px 31px 23px}
.safe-mechanics{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;min-width:0}
.safe-door-face{width:min(100%,280px);aspect-ratio:1;display:grid;place-items:center;border-radius:50%;
  border:9px solid #242b35;background:conic-gradient(from 60deg,#323943,#838b97,#252b33,#626b78,#202630,#8a939e,#313944);
  box-shadow:0 0 0 2px #b9bec677,0 0 0 7px #20242d,0 0 0 10px #64707c,0 16px 23px #0304079c,
  inset 0 0 0 5px #161c25,inset 0 0 0 12px #737d8a88,inset 0 8px 20px #080b14;}
.safe-spindle{position:relative;width:74%;aspect-ratio:1;display:grid;place-items:center;transform:rotate(0deg);transition:transform .65s ease}
.safe-stage.is-open .safe-spindle{transform:rotate(42deg)}
.safe-spoke{position:absolute;z-index:1;box-shadow:inset 0 2px 2px #c4cbd9,inset 0 -3px 2px #11151f,0 2px 5px #05080f9c;background:linear-gradient(90deg,#454e59,#a6aebb 45%,#56606a);border:2px solid #1d232d;border-radius:8px}
.safe-spoke.north,.safe-spoke.south{width:21%;height:67%;left:39.5%;top:-16%}
.safe-spoke.south{top:49%}
.safe-spoke.east,.safe-spoke.west{width:68%;height:21%;left:48%;top:39.5%}
.safe-spoke.west{left:-16%}
.safe-dial-ring{position:relative;z-index:2;width:66%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;
  background:radial-gradient(circle at 33% 28%,#939ba6,#454b55 46%,#121821 75%);
  border:3px solid #aab0b9;box-shadow:0 0 0 6px #171d28,0 0 0 8px #6a7681,0 10px 18px #000c,inset 0 2px 3px #e5ecf4aa}
.safe-stage .vault-inner{width:60%;height:60%;margin:0;border:2px solid #19222a;border-radius:50%;background:linear-gradient(130deg,#1e252e,#0e131b);box-shadow:inset 0 5px 13px #000,0 0 0 4px #656f79;display:grid;place-items:center}
.safe-stage .vault-inner svg{width:57%;height:57%;stroke:#f77f88}
.safe-stage.is-open .vault-inner svg{stroke:#73efad}
.clock-panel{position:relative;max-width:270px;min-height:0;width:100%;margin:0;padding:10px 17px 12px;
  background:linear-gradient(130deg,#10151d,#1e2531);border:1px solid #818b9699;border-radius:9px;box-shadow:inset 0 3px 10px #000c,0 3px 10px #080a0dc4}
.clock-panel .setting-label{font-size:10px;letter-spacing:.15em;color:#aeb9c9}
.clock-panel strong{font-size:clamp(27px,2.8vw,40px);color:#ff9a95;letter-spacing:.085em;font-weight:850;text-shadow:0 0 12px #ff45454a}
.clock-panel span{font-size:11px}
.safe-controls{min-width:0;border:1px solid #7c87945e;border-radius:13px;padding:17px 22px;
 background:linear-gradient(140deg,#181d26,#121821 65%,#1b222c);box-shadow:inset 0 2px 0 #b2bbca23,0 10px 28px #05070cb0}
.safe-controls-header{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#c4cad3;font-size:11px;letter-spacing:.2em;font-weight:900}
.safe-port-label{font-size:9px;color:#7f8b9c}
.vault-sub{margin:6px 0 11px;font-size:12px;text-align:left;color:#adb6c4}
.input-area{margin:0}
.input-area .setting-label{font-size:11px;letter-spacing:.06em;display:block;margin:0 0 7px;color:#b8c6d5}
.display-housing{position:relative;padding:13px 15px;border-radius:9px;border:3px solid #090b11;
 background:linear-gradient(180deg,#05070a,#090c10 40%,#0b1117);box-shadow:0 0 0 1px #646973,0 8px 15px #0008,inset 0 0 14px #000;min-height:100px;
 overflow:hidden;cursor:text;}
.display-housing:focus-within{outline:2px solid #ffb2ad;outline-offset:3px}
.segment-display{display:flex;align-items:center;justify-content:center;gap:clamp(4px,.85vw,12px);height:70px;max-width:100%;pointer-events:none}
.seven-digit{display:block;flex:1 1 0;min-width:0;max-width:59px;height:64px;position:relative;filter:drop-shadow(0 0 1px #fb312020)}
.seg{display:block;position:absolute;background:#442324;opacity:.48;transition:background .08s,opacity .08s;}
.seg.lit{background:var(--display-red);opacity:1;box-shadow:0 0 10px #ff39398b,0 0 3px #ff6c5e;}
.seg-a,.seg-d,.seg-g{width:61%;height:10%;left:19%;clip-path:polygon(13% 0,87% 0,100% 50%,87% 100%,13% 100%,0 50%)}
.seg-a{top:3%}.seg-g{top:45%}.seg-d{bottom:3%}
.seg-b,.seg-c,.seg-e,.seg-f{width:13%;height:39%;clip-path:polygon(50% 0,100% 10%,100% 90%,50% 100%,0 90%,0 10%)}
.seg-b{top:8%;right:10%}.seg-c{bottom:8%;right:10%}.seg-e{bottom:8%;left:10%}.seg-f{top:8%;left:10%}
.display-housing .code-entry{position:absolute;z-index:2;inset:0;width:100%;height:100%;opacity:0;color:transparent;caret-color:transparent;cursor:text;font-size:22px;border:0;padding:0;margin:0;box-shadow:none}
.display-housing .code-entry:focus{border:0;outline:0;box-shadow:none}
.display-glass{position:absolute;inset:0;pointer-events:none;border-radius:6px;background:linear-gradient(127deg,#ffffff10 0%,#ffffff00 37%,#ffffff06 58%,#ffffff00 78%);z-index:1}
.error{min-height:19px;margin:5px 0 4px;font-size:12px;color:#ffa8a8}
.safe-keyboard-area{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(155px,.88fr);gap:20px;align-items:center}
.safe-keyboard-area .keypad{margin:0;width:100%;max-width:none;gap:8px}
.safe-keyboard-area .key{height:46px;border-radius:7px;border:1px solid #727984;background:linear-gradient(150deg,#404855,#222833);box-shadow:0 3px 0 #0b1018, inset 0 1px 0 #a0a9ba42;color:#f5f6f7;font-size:19px}
.safe-keyboard-area .key:hover:not(:disabled){background:linear-gradient(150deg,#56616e,#313947)}
.safe-keyboard-area .key:active{transform:translateY(2px);box-shadow:0 1px 0 #0b1018}
.safe-keyboard-area .key.alt{color:#ffb3b3}
.safe-actioncol{display:flex;flex-direction:column;gap:13px;align-items:stretch;justify-content:center}
.safe-auth-mark{font-size:10px;letter-spacing:.08em;color:#94a6b4;display:flex;gap:6px;align-items:center}
.auth-dot{width:8px;height:8px;border-radius:50%;background:#ee7570;box-shadow:0 0 9px #ea5953}
.safe-actioncol .submit{max-width:none;width:100%;min-height:82px;border-radius:8px;padding:14px 10px;font-size:15px;letter-spacing:.07em;white-space:normal;box-shadow:inset 0 1px 0 #ffb5bb77,0 4px 0 #6b1d2a}
.safe-actioncol .submit span{display:block;margin-top:4px}
.safe-warning{font-size:10px;line-height:1.5;color:#a6afb9}
.safe-controls .actions{justify-content:flex-start;margin-top:10px;gap:9px}
.safe-controls .actions .button{padding:8px 11px;min-height:38px;font-size:12px;border-color:#49515c;background:#28303a}
.safe-controls .result.show{margin-top:13px}
.safe-footbar{padding:9px 30px;background:linear-gradient(90deg,#151d26aa,#10151dbb);border-top:1px solid #8a939a2e;color:#8493a2;font-size:9px;letter-spacing:.15em}
.clues-section{margin:0 0 16px}
.clues-heading{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:0 0 12px}
.clues-heading h2{font-size:25px;margin:3px 0}
.clues-heading p{font-size:13px;color:#c5c1c8;margin:0}
.clues-panel{max-width:none}
.clues-panel .clue-guide{display:flex;gap:10px 22px;align-items:center;flex-wrap:wrap;padding:14px 21px}
.clues-panel .clue-guide strong:first-child{white-space:nowrap}
.clues-panel .clue-table{min-width:390px}
.clues-panel .clue-table td{padding-top:8px;padding-bottom:8px}
.clues-panel .clue-table th:first-child,.clues-panel .clue-table td:first-child{width:11%}
.clues-panel .clue-table th:nth-child(2),.clues-panel .clue-table td:nth-child(2){width:41%}
.clues-panel .clue-table th:nth-child(3),.clues-panel .clue-table td:nth-child(3){width:24%}
.clues-panel .clue-table .numbercode span{height:34px;width:30px}
.safe-stage.is-open .safe-frame{border-color:#6fae8a}
@media(max-width:1050px){
  .safe-main{grid-template-columns:minmax(190px,.75fr) minmax(0,1.4fr);gap:18px;padding:20px}
  .safe-keyboard-area{gap:13px}
  .safe-door-face{width:min(100%,240px)}
  .safe-controls{padding:15px}
}
@media(max-width:790px){
 .safe-main{grid-template-columns:1fr;gap:15px}
 .safe-mechanics{flex-direction:row;justify-content:space-evenly;gap:20px}
 .safe-door-face{width:min(32vw,175px)}
 .clock-panel{max-width:260px}
 .safe-controls{width:100%}
}
@media(max-width:620px){
 .shell{width:calc(100% - 24px);padding-top:12px}
 .top{margin-bottom:10px}
 h1{font-size:30px}
 .hero>p{font-size:13px}
 .safe-frame{padding:8px;border-radius:13px}
 .safe-plate{border-radius:8px}
 .safe-rivet{width:13px;height:13px}
 .safe-topbar{padding:13px 13px 9px;align-items:center}
 .safe-engraving{gap:7px}
 .safe-engraving-symbol{width:27px;height:27px;font-size:20px}
 .safe-engraving span:not(.safe-engraving-symbol){font-size:15px;letter-spacing:.15em}
 .safe-engraving small{font-size:7px;letter-spacing:.08em}
 .safe-lockstate{padding:6px 7px;font-size:9px;gap:6px}
 .safe-led{width:7px;height:7px}
 .safe-main{padding:14px 11px;gap:13px}
 .safe-mechanics{gap:10px}
 .safe-door-face{width:113px;border-width:6px;box-shadow:0 0 0 2px #b9bec677,0 0 0 4px #20242d,0 0 0 6px #64707c,0 7px 16px #0304079c,inset 0 0 0 5px #161c25}
 .safe-dial-ring{border-width:2px;box-shadow:0 0 0 3px #171d28,0 0 0 5px #6a7681,0 6px 12px #000c}
 .clock-panel{width:auto;max-width:225px;min-height:84px;flex:1;padding:9px 5px}
 .clock-panel strong{font-size:27px}
 .clock-panel .setting-label{font-size:8px}
 .clock-panel span{font-size:9px}
 .safe-controls{padding:12px 10px}
 .safe-controls-header{font-size:10px}
 .safe-port-label{font-size:8px}
 .display-housing{min-height:73px;padding:8px 10px}
 .segment-display{height:53px;gap:4px}
 .seven-digit{height:49px;max-width:44px}
 .safe-keyboard-area{grid-template-columns:minmax(0,1fr) minmax(120px,.8fr);gap:10px}
 .safe-keyboard-area .key{height:44px;font-size:17px}
 .safe-actioncol .submit{min-height:72px;font-size:12px}
 .safe-warning{font-size:9px}
 .safe-controls .actions{flex-wrap:wrap}
 .safe-footbar{padding:8px 11px;font-size:7px;letter-spacing:.08em}
 .clues-heading h2{font-size:21px}
 .clues-panel .clue-guide{padding:12px}
}
@media(max-width:360px){
 .safe-mechanics{gap:8px}
 .safe-door-face{width:88px}
 .clock-panel strong{font-size:25px}
 .safe-keyboard-area{grid-template-columns:minmax(0,1fr) minmax(108px,.85fr);gap:8px}
 .safe-actioncol .submit{font-size:11px}
 .safe-main{padding:11px 8px}
 .segment-display{gap:3px}
 .seven-digit{height:43px}
 .clues-heading .status-tag{font-size:10px;padding:6px}
}
@media(prefers-reduced-motion:reduce){.safe-spindle,.seg{transition:none}}


/* === Tresor 09: Safe-first / LOCKED feedback / mobile keypad V2 === */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.shell{padding-top:12px}
.safe-stage{margin-top:0}
.safe-right-meta{display:flex;align-items:center;justify-content:flex-end;gap:14px;flex-wrap:wrap}
.safe-home-link{color:#e5dae0;text-decoration:none;font-size:13px;font-weight:750;white-space:nowrap}
.safe-home-link:hover,.safe-home-link:focus-visible{color:#fff;text-decoration:underline}
.safe-engraving small{letter-spacing:.08em;font-size:11px;text-transform:none;color:#cbd3df}
.safe-engraving span:not(.safe-engraving-symbol){letter-spacing:.12em}
.safe-case-meta{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:4px 0 8px}
.safe-case-meta .mode-tag{margin:0;border-radius:8px;font-size:11px;padding:5px 8px}
.safe-case-meta .status-tag{font-size:10px;padding:6px 8px}
.safe-controls .vault-sub{margin:0 0 9px}
.display-housing{padding-bottom:8px;min-height:130px;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:8px}
.segment-display{flex:0 0 auto;height:66px}
.segment-display .seven-digit{height:60px}
.segment-display.is-locked{gap:clamp(2px,.6vw,8px)}
.segment-display.is-locked .seven-digit{max-width:46px}
.display-feedback{position:relative;z-index:2;color:#f4b7af;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:clamp(12px,1.45vw,15px);font-weight:800;text-align:center;letter-spacing:.035em;line-height:1.4;min-height:22px;overflow-wrap:anywhere}
.display-feedback.is-error{color:#ffafb0;text-shadow:0 0 9px #9d1b2659}
.display-feedback.is-success{color:#9dffca;text-shadow:0 0 9px #29704f69}
.display-housing .code-entry{pointer-events:none;cursor:default}
.safe-keyboard-area{display:flex;justify-content:center;align-items:center;margin:10px 0 0}
.safe-keyboard-area .keypad{max-width:320px;width:100%;margin:0 auto}
.safe-actioncol{display:none}
.safe-action-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0 0}
.safe-action-buttons .button{min-height:54px;padding:9px 8px;font-size:13px;font-weight:850;border-radius:9px;line-height:1.2;white-space:normal}
.safe-action-buttons .submit{box-shadow:inset 0 1px #ffb5bb77,0 3px 0 #6b1d2a}
.safe-controls .result.show{margin-top:12px}
.solution-link{display:block;margin:10px auto 0;color:#abb3c1;background:transparent;border:0;padding:6px 8px;font-size:11px;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
.solution-link:hover,.solution-link:focus-visible{color:#ffb0b8}
.clues-panel .clue-guide{display:none}
.clues-panel .clue-table{min-width:0;width:100%;table-layout:fixed}
.clues-panel .clue-table th{font-size:12px;text-transform:none;letter-spacing:0;line-height:1.3;white-space:normal}
.clues-panel .clue-table th:first-child,.clues-panel .clue-table td:first-child{width:41%;padding-left:18px}
.clues-panel .clue-table th:nth-child(2),.clues-panel .clue-table td:nth-child(2){width:29.5%;text-align:center}
.clues-panel .clue-table th:nth-child(3),.clues-panel .clue-table td:nth-child(3){width:29.5%;text-align:center;padding-right:14px}
.clues-panel .clue-table td{padding:11px 8px}
.clues-panel .clue-table .numbercode{justify-content:flex-start}
.clues-panel .clue-table .value{margin:auto}
.new-case-dialog{width:min(460px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;background:#1b1c25;color:#f7f0f2;border:1px solid #a15464;border-radius:17px;padding:0;box-shadow:0 25px 90px #000d}
.new-case-dialog::backdrop{background:rgba(0,0,0,.77);backdrop-filter:blur(3px)}
.new-case-content{padding:23px;display:flex;flex-direction:column;gap:14px}
.new-case-content .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.new-case-content h2{margin:0;font-size:24px}
.new-case-content p{margin:0;color:#c8c2cb;font-size:14px;line-height:1.6}
.new-case-content .setting-label{font-weight:750}
.new-case-content .choose{width:100%;min-height:48px}
.dialog-x{display:grid;place-items:center;min-width:40px;min-height:40px;background:#252630;border:1px solid #59515c;border-radius:10px;color:#fff;font-size:24px}
.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin-top:7px}
.dialog-actions .button{min-height:48px}
@media(max-width:790px){.safe-stage{margin-top:0}}
@media(max-width:620px){
 .shell{width:calc(100% - 20px);padding-top:9px}
 .safe-topbar{padding:10px 12px;gap:7px}
 .safe-engraving small{font-size:9px}
 .safe-home-link{font-size:11px}
 .safe-right-meta{gap:6px}
 .safe-lockstate{font-size:9px}
 .safe-main{padding:13px 10px}
 .safe-mechanics{gap:10px}
 .safe-controls{padding:12px}
 .display-housing{min-height:114px;padding:8px}
 .segment-display{height:55px}
 .segment-display .seven-digit{height:50px}
 .safe-action-buttons{gap:5px;margin-top:12px}
 .safe-action-buttons .button{font-size:12px;padding:8px 4px;min-height:52px}
 .display-feedback{font-size:12px}
 .clues-panel .clue-table{display:table;min-width:0}
 .clues-panel .clue-table thead{display:table-header-group}
 .clues-panel .clue-table tbody{display:table-row-group}
 .clues-panel .clue-table tbody tr{display:table-row;padding:0;border-top:0}
 .clues-panel .clue-table td{display:table-cell!important;vertical-align:middle!important;padding:9px 3px!important;border-bottom:1px solid #30313a!important}
 .clues-panel .clue-table td:before{content:none!important;display:none!important}
 .clues-panel .clue-table th{padding:9px 3px;font-size:10px}
 .clues-panel .clue-table th:first-child,.clues-panel .clue-table td:first-child{width:43%;padding-left:8px!important}
 .clues-panel .clue-table th:nth-child(2),.clues-panel .clue-table td:nth-child(2){width:28.5%}
 .clues-panel .clue-table th:nth-child(3),.clues-panel .clue-table td:nth-child(3){width:28.5%;padding-right:5px!important}
 .clues-panel .clue-table .numbercode{gap:2px;justify-content:flex-start}
 .clues-panel .clue-table .numbercode span{width:clamp(17px,5vw,26px);height:30px;font-size:13px;border-radius:5px}
 .clues-panel .clue-table .value{width:29px;height:30px;font-size:14px}
}
@media(max-width:360px){
 .safe-engraving span:not(.safe-engraving-symbol){font-size:13px;letter-spacing:.08em}
 .safe-engraving small{font-size:8px}
 .safe-home-link{font-size:10px}
 .safe-lockstate{font-size:8px;padding:5px}
 .safe-action-buttons .button{font-size:11px}
 .clues-panel .clue-table .numbercode span{width:18px;height:26px;font-size:12px}
 .clues-panel .clue-table .value{width:25px;height:27px}
}


/* === Tresor 09 V3: Blindmodus und Goldbelohnung (2026-11-14) === */
/* All effects are scoped to the isolated game page. No remote assets. */
.safe-door-face{position:relative}
.safe-spindle{will-change:transform;transform-origin:50% 50%}
.safe-stage.is-turning:not(.is-open) .safe-spindle{animation:nsd-lock-check 1.05s cubic-bezier(.3,.05,.24,1) both}
@keyframes nsd-lock-check{0%{transform:rotate(0)}40%{transform:rotate(58deg)}70%{transform:rotate(-18deg)}100%{transform:rotate(0)}}
.safe-stage.is-open .safe-spindle{transform:rotate(135deg);transition:transform 1.15s cubic-bezier(.16,.8,.22,1)}
.safe-stage.is-celebrating .safe-door-face{animation:nsd-safe-glow 2.8s ease-out 1}
@keyframes nsd-safe-glow{0%,100%{filter:none}30%{filter:drop-shadow(0 0 22px #f9bf5599)}}
.treasure-chamber{max-height:0;opacity:0;width:min(90%,260px);overflow:hidden;transition:max-height .85s ease,opacity .7s ease,margin .7s ease;margin:0 auto;pointer-events:none}
.safe-stage.is-open .treasure-chamber{max-height:200px;opacity:1;margin:0 auto 4px}
.treasure-inner{position:relative;text-align:center;padding:14px 12px 13px;background:radial-gradient(ellipse at 50% 0%,#7a541e,#252015 55%,#17151b);border:5px solid #5a6069;border-radius:10px;box-shadow:inset 0 6px 19px #070608,0 0 0 2px #b1a58c55;min-height:140px}
.treasure-inner:before{content:'';position:absolute;inset:7px;border:1px solid #f6c46e38;border-radius:4px;pointer-events:none}
.treasure-inner strong{display:block;font-size:13px;letter-spacing:.13em;color:#ffe0a0;text-shadow:0 0 9px #ffd06b77;position:relative;z-index:1}
.treasure-inner small{display:block;color:#dbc38a;font-size:11px;position:relative;z-index:1}
.gold-stack{height:77px;width:min(185px,100%);margin:0 auto 2px;position:relative;filter:drop-shadow(0 8px 8px #0009)}
.gold-bar{position:absolute;width:66px;height:29px;display:block;background:linear-gradient(160deg,#ffe4a1 0%,#ffcf51 20%,#e39d1a 48%,#a86e10 77%,#6e450e 100%);border:1px solid #ffeabb;border-radius:4px;transform:skew(-14deg);box-shadow:inset 0 5px 2px #fff7,inset 0 -5px 4px #6f451e88,2px 5px 0 #855616}
.gold-bar:after{content:'999.9';position:absolute;inset:5px 5px auto;text-align:center;font-size:9px;letter-spacing:.06em;font-weight:900;color:#70431b;text-shadow:0 1px #fff7}
.gold-bar-back-left{left:18px;top:10px}.gold-bar-back-right{right:18px;top:10px}
.gold-bar-left{left:5px;top:37px}.gold-bar-right{right:5px;top:37px}.gold-bar-front{left:50%;top:40px;transform:translateX(-50%) skew(-14deg)}
.money-rain{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:7;border-radius:18px}
.falling-note{position:absolute;top:-34px;left:var(--x);font:900 15px ui-sans-serif,system-ui,sans-serif;letter-spacing:-.15em;color:#276e49;text-shadow:0 1px #defbb6;display:grid;place-items:center;width:44px;height:23px;border:2px solid #d5e8ad;border-radius:4px;background:repeating-linear-gradient(90deg,#bcdeaa 0 6px,#a9d28d 6px 12px);box-shadow:0 4px 9px #0005;opacity:0;animation:nsd-money-fall var(--duration) ease-in var(--delay) forwards}
@keyframes nsd-money-fall{0%{transform:translate3d(0,-15px,0) rotate(-25deg);opacity:0}9%{opacity:1}87%{opacity:1}100%{transform:translate3d(var(--sway),680px,0) rotate(380deg);opacity:0}}
/* Seven digit modes must fit at 320px. */
.segment-display[data-slots="7"]{gap:clamp(1px,.38vw,5px)}
.segment-display[data-slots="7"] .seven-digit{max-width:48px}
.safe-stage.is-open .safe-lockstate{border-color:#5f987a;color:#b7f2d5}
@media(max-width:790px){
 .safe-mechanics{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:center;justify-items:center}
 .safe-mechanics .safe-door-face{grid-column:1;grid-row:1}
 .safe-mechanics .clock-panel{grid-column:2;grid-row:1;width:100%}
 .safe-mechanics .treasure-chamber{grid-column:1/-1;grid-row:2;width:min(280px,100%)}
}
@media(max-width:620px){
 .safe-stage.is-open .treasure-chamber{max-height:160px}
 .treasure-inner{min-height:128px;padding:8px 8px 10px}
 .gold-stack{transform:scale(.84);transform-origin:bottom center;height:64px}
 .segment-display[data-slots="7"] .seven-digit{height:46px}
 .display-housing{padding-left:5px;padding-right:5px}
}
@media(max-width:360px){.segment-display[data-slots="7"] .seven-digit{height:40px}.segment-display[data-slots="7"]{gap:1px}}
@media(prefers-reduced-motion:reduce){
 .safe-stage.is-turning .safe-spindle,.safe-stage.is-celebrating .safe-door-face,.falling-note{animation:none!important}
 .safe-stage.is-open .safe-spindle,.treasure-chamber{transition:none!important}
 .money-rain{display:none}
}


/* Tresor 09 – Inline-Hinweisdisplay V2, 2026-11-15.
 * Swaps only code LCD + keypad with the clue LCD inside the safe.
 * No backdrop, dialog, page scroll jump, server request, or game API change.
 */
.safe-hints-trigger {
 display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:43px;
 padding:7px 12px;color:#fff0eb;font-size:13px;font-weight:850;letter-spacing:.025em;
 border:1px solid #dc8a76;border-radius:9px;background:linear-gradient(160deg,#673442,#3b202f);
 box-shadow:inset 0 1px 0 #ffe4e24d,0 3px 8px #0006;white-space:nowrap;
}
.safe-hints-trigger:hover:not(:disabled){border-color:#ffc3aa;background:linear-gradient(160deg,#804154,#512639)}
.safe-hints-trigger .hints-icon{font-size:19px;line-height:1}
.safe-hints-trigger .hints-count{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:6px;background:#140f16;color:#ffe0cf;font-variant-numeric:tabular-nums}
.safe-hints-trigger[hidden],.safe-hints-trigger .hints-count[hidden],.safe-entry-panel[hidden],.safe-hints-panel[hidden]{display:none!important}
.safe-hints-panel{margin:0;min-width:0;width:100%;background:linear-gradient(145deg,#101721,#10151c);border:2px solid #505d6b;border-radius:10px;padding:9px;box-shadow:inset 0 0 15px #030406,0 0 0 1px #111c26}
.safe-hints-heading{display:flex;justify-content:space-between;align-items:center;gap:6px;margin:0 0 7px}
.safe-hints-heading .setting-label{display:block;font-size:10px;letter-spacing:.07em;margin:0 0 1px;color:#c6d1dd}
.safe-hints-heading h2{font-size:20px;margin:0;color:#ffe2d5;line-height:1.2}
.safe-hints-heading h2:focus{outline:none}
.safe-hints-heading p{font-size:11px;margin:2px 0 0;color:#c7c7d0}
.safe-hints-heading .status-tag{padding:5px 7px;border-radius:6px;font-size:10px;white-space:nowrap}
.safe-hints-panel .clues-panel{background:#10151d;box-shadow:none;border:1px solid #394552;border-radius:6px;overflow:hidden;max-width:100%}
.safe-hints-panel .clue-scroll{overflow:visible;max-height:none}
.safe-hints-panel .clue-table{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse}
.safe-hints-panel .clue-table th{padding:8px 4px;font-size:10px;text-align:center;letter-spacing:0;line-height:1.2;text-transform:none;color:#ffd3d6;background:#232a35;white-space:normal}
.safe-hints-panel .clue-table th:first-child,.safe-hints-panel .clue-table td:first-child{width:49%;text-align:left;padding-left:7px!important}
.safe-hints-panel .clue-table th:nth-child(2),.safe-hints-panel .clue-table td:nth-child(2){width:25.5%;text-align:center}
.safe-hints-panel .clue-table th:nth-child(3),.safe-hints-panel .clue-table td:nth-child(3){width:25.5%;text-align:center;padding-right:4px!important}
.safe-hints-panel .clue-table td{padding:5px 3px!important;border-top:1px solid #293542!important;vertical-align:middle!important}
.safe-hints-panel .clue-table tbody tr{display:table-row!important}
.safe-hints-panel .clue-table td:before{display:none!important;content:none!important}
.safe-hints-panel .numbercode{gap:2px;justify-content:flex-start;max-width:100%}
.safe-hints-panel .numbercode span{width:clamp(17px,2.5vw,26px);height:28px;border-radius:4px;font-size:13px;background:#2e3846;border-color:#576477}
.safe-hints-panel .value{height:27px;width:27px;border-radius:6px;font-size:14px;margin:auto}
.safe-hints-panel .panel-foot{border-top:1px solid #394552;padding:6px 7px;font-size:10px;color:#c3d3ce;line-height:1.2}
.safe-hints-panel .unique-indicator{flex:0 0 8px}
.hint-short-label{display:none}
@media(max-width:1050px){
 .safe-hints-panel .hint-long-label{display:none}
 .safe-hints-panel .hint-short-label{display:inline}
}
@media(max-width:620px){
 .safe-controls-header{gap:7px}
 .safe-hints-trigger{min-height:40px;padding:6px 9px;font-size:12px;gap:4px}
 .safe-hints-trigger .hints-count{height:22px;min-width:22px}
 .safe-hints-panel{padding:6px}
 .safe-hints-heading h2{font-size:18px}
 .safe-hints-heading .setting-label{font-size:9px}
 .safe-hints-heading .status-tag{font-size:9px;padding:4px}
 .safe-hints-panel .clue-table th{font-size:9px;padding:6px 2px}
 .safe-hints-panel .clue-table td{padding:4px 2px!important}
 .safe-hints-panel .clue-table th:first-child,.safe-hints-panel .clue-table td:first-child{width:51%;padding-left:4px!important}
 .safe-hints-panel .clue-table th:nth-child(2),.safe-hints-panel .clue-table td:nth-child(2){width:24.5%}
 .safe-hints-panel .clue-table th:nth-child(3),.safe-hints-panel .clue-table td:nth-child(3){width:24.5%}
 .safe-hints-panel .numbercode span{width:clamp(15px,4.6vw,24px);height:25px;font-size:12px}
 .safe-hints-panel .value{width:24px;height:24px;font-size:12px}
 .safe-hints-panel .panel-foot{font-size:9px;padding:5px 4px}
}
@media(max-width:360px){
 .safe-hints-panel .numbercode{gap:1px}
 .safe-hints-panel .numbercode span{width:clamp(13px,4.3vw,18px);height:23px;font-size:11px}
 .safe-hints-panel .value{width:21px;height:23px;font-size:11px}
 .safe-hints-panel .clue-table th{font-size:8px}
}

/* Tresor 09 V4: switchable LCD/keypad viewport, without a second return button.
 * The header's Hinweise/Eingabe control is the single accessible toggle.
 * The viewport always matches the measured natural keypad height; only the
 * clue rows scroll internally if they cannot all fit. No whole-safe reflow. */
.safe-terminal-view{min-width:0;width:100%;overflow:hidden}
.safe-terminal-view>.safe-hints-panel{height:100%;max-height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.safe-terminal-view>.safe-hints-panel[hidden]{display:none!important}
.safe-terminal-view>.safe-hints-panel .safe-hints-heading{flex:0 0 auto}
.safe-terminal-view>.safe-hints-panel .clues-panel{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.safe-terminal-view>.safe-hints-panel .clue-scroll{flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#687788 #151b25}
.safe-terminal-view>.safe-hints-panel .clue-table thead th{position:sticky;top:0;z-index:1}
.safe-terminal-view>.safe-hints-panel .panel-foot{flex:0 0 auto}
/* Prefer showing the complete standard 6/7-clue table without scrolling. */
.safe-terminal-view>.safe-hints-panel .safe-hints-heading{margin-bottom:3px}
.safe-terminal-view>.safe-hints-panel .clue-table th{padding-top:5px;padding-bottom:5px}
.safe-terminal-view>.safe-hints-panel .clue-table td{padding-top:2px!important;padding-bottom:2px!important}
.safe-terminal-view>.safe-hints-panel .panel-foot{padding-top:4px;padding-bottom:4px}
@media(max-width:620px){
 .safe-terminal-view>.safe-hints-panel .clue-table td{padding-top:1px!important;padding-bottom:1px!important}
}
.safe-terminal-view>.safe-hints-panel .numbercode span{height:26px}
.safe-terminal-view>.safe-hints-panel .value{height:25px}
@media(max-width:620px){
 .safe-terminal-view>.safe-hints-panel .numbercode span{height:25px}
 .safe-terminal-view>.safe-hints-panel .value{height:24px}
}

/* Tresor 09 V5 / responsive result image share dialog; no changes to safe layout. */
.result-share-dialog { border:1px solid #785536; border-radius:18px; padding:0; width:min(540px, calc(100vw - 24px)); max-height:min(92dvh, 980px); background:#17151b; color:#f6f1ed; box-shadow:0 35px 110px #000d; }
.result-share-dialog::backdrop { background:#09070bcc; }
.result-share-content { padding:18px; display:grid; gap:14px; }
.result-share-dialog .dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.result-share-dialog .dialog-head h2 { color:#fbe5ba; font-size:20px; }
.result-share-dialog .dialog-x { min-width:40px; min-height:40px; color:#f6f1ed; border:1px solid #67575e; background:#28242d; border-radius:10px; font-size:25px; }
.result-share-dialog p { margin:0; font-size:13px; line-height:1.5; color:#d8cdd0; }
.result-share-preview-frame { display:grid; place-items:center; min-height:150px; }
.result-share-preview-frame img { width:auto; height:auto; max-width:min(100%,340px); max-height:min(46dvh,520px); aspect-ratio:4 / 5; object-fit:contain; border:1px solid #5f4e42; border-radius:8px; }
.result-share-actions { display:flex; flex-wrap:wrap; gap:8px; }
.result-share-actions .button { flex:1 1 150px; min-height:44px; padding:10px; }
.result-share-dialog .result-share-feedback { font-size:12px; color:#e9d09d; }
@media (max-width:420px) { .result-share-content{padding:12px;gap:10px;} .result-share-preview-frame img{max-height:42dvh;} }

/* Tresor 09 V2: clear primary share route with explicit desktop fallback. */
.result-share-actions #result-share-native { flex-basis:100%; min-height:52px; }
.result-share-dialog .result-share-help { font-size:13px; color:#f3ddad; line-height:1.5; border-left:3px solid #c59c54; padding:4px 10px; }

/* Tresor 09 V2b: compact control header – remove redundant titles and save height.
 * The case ID and Hinweise/Eingabe remain reachable in the same compact row.
 * The stable keypad/hints viewport and keypad sizes are intentionally untouched. */
.safe-controls-header{margin:0 0 9px;letter-spacing:normal}
.safe-controls-header .status-tag{display:inline-flex;align-items:center;min-width:0;max-width:100%;overflow-wrap:anywhere;font-size:10px;letter-spacing:.035em;padding:6px 8px}
.safe-controls-header .safe-hints-trigger{margin-left:auto}
@media(max-width:620px){
 .safe-controls-header{gap:6px;margin-bottom:7px}
 .safe-controls-header .status-tag{font-size:9px;padding:5px 6px}
}
@media(max-width:340px){
 /* Keep the full case code visible even as the hint-count badge appears/disappears. */
 .safe-controls-header .status-tag{min-height:45px}
}

/* Tresor 09 / Mobile Design V3: compact BOTH terminal views, score dialog.
 * Stopwatch display and timing deliberately untouched. */
.safe-engraving small {font-size:10px;letter-spacing:.10em}
.safe-leaderboard-trigger {display:block;width:100%;min-height:43px;margin-top:10px;
 background:linear-gradient(135deg,#33303b,#252633);color:#f5e3bd;border:1px solid #6e5f59;
 border-radius:9px;font-weight:800;font-size:13px;letter-spacing:.025em;
 box-shadow:inset 0 1px 0 #ffffff20,0 2px 0 #0b0e15}
.safe-leaderboard-trigger:hover {background:linear-gradient(135deg,#483a40,#30303b);border-color:#c29b72}
.safe-leaderboard-trigger.needs-score {border-color:#c5a05b;color:#ffdda0;box-shadow:0 0 0 1px #99733c66,inset 0 1px 0 #ffffff22}
.safe-leaderboard-trigger:focus-visible {outline:3px solid #fff0ad;outline-offset:3px}
.leaderboard-dialog {width:min(730px,calc(100vw - 20px));max-height:min(90dvh,900px);
 padding:0;overflow-y:auto;overscroll-behavior:contain;border-radius:16px;
 color:#f5edf1;background:linear-gradient(155deg,#20202a,#141721);border:1px solid #8b676a;
 box-shadow:0 28px 100px #000d}
.leaderboard-dialog::backdrop{background:#07080cdb;backdrop-filter:blur(3px)}
.leaderboard-dialog-content{padding:clamp(13px,3vw,24px)}
.leaderboard-dialog .dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.leaderboard-dialog .dialog-head h2{font-size:clamp(21px,4vw,27px);color:#ffe0b9;margin:0}
.leaderboard-dialog-content>p{color:#c5c5d0;line-height:1.45;font-size:13px;margin:9px 0 0}
.leaderboard-dialog .leaderboard-section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.leaderboard-dialog .leaderboard-section .score-card{grid-column:1 / -1}
.leaderboard-dialog .leaderboard-section .mini-panel{min-width:0;padding:15px;margin:0}
.leaderboard-dialog .leaderboard-section .mini-panel h2{font-size:17px}
.leaderboard-dialog .leaders{max-height:26dvh;overflow:auto;overscroll-behavior:contain}
.leaderboard-dialog .score-note{font-size:12px;line-height:1.5}
.leaderboard-dialog .score-submit{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch;gap:9px}
.leaderboard-dialog .score-submit input{flex:1 1 185px;width:auto}
.leaderboard-dialog .score-submit button{flex:0 1 auto;min-height:45px}
/* Only the terminal's contents are trimmed; keypad targets remain touch sized. */
.safe-terminal-view>.safe-hints-panel .safe-hints-heading{display:block;margin-bottom:3px}
.safe-terminal-view>.safe-hints-panel .safe-hints-titleline{display:flex;align-items:center;justify-content:space-between;gap:7px}
.safe-terminal-view>.safe-hints-panel .safe-hints-heading h2{font-size:17px;line-height:1.1}
.safe-terminal-view>.safe-hints-panel .safe-hints-heading p{font-size:10px;margin:2px 0 0}
.safe-terminal-view>.safe-hints-panel .safe-hints-heading .status-tag{font-size:10px;padding:3px 6px}
.safe-terminal-view>.safe-hints-panel .numbercode span{height:25px}
.safe-terminal-view>.safe-hints-panel .value{height:25px}
.safe-terminal-view>.safe-hints-panel .clue-table td{padding-top:2px!important;padding-bottom:2px!important}
@media (max-width:790px){
 .safe-topbar{padding:10px 15px 9px}
 .safe-main{gap:11px;padding:11px 12px}
 .safe-mechanics{gap:8px}
 .safe-mechanics .safe-door-face{width:min(100%,155px)}
 .safe-engraving span:not(.safe-engraving-symbol){font-size:clamp(14px,4vw,18px)}
 .safe-engraving small{font-size:9px;letter-spacing:.05em}
 .safe-engraving-symbol{width:29px;height:29px;font-size:20px;flex:0 0 29px}
 .safe-right-meta{gap:5px}
 .safe-lockstate{padding:6px 8px;gap:6px}
 .safe-controls{padding:10px 12px 12px}
 .safe-controls-header{margin-bottom:6px}
 .safe-keyboard-area{margin-top:7px}
 .safe-keyboard-area .keypad{gap:6px}
 .safe-keyboard-area .key{height:45px;min-height:44px}
 .display-housing{min-height:88px;padding:5px 7px}
 .segment-display{height:49px}
 .segment-display .seven-digit{height:45px}
 .display-feedback{min-height:19px}
 .safe-action-buttons{margin-top:10px}
 .safe-action-buttons .button{min-height:48px}
 .safe-terminal-view>.safe-hints-panel .numbercode span{height:24px}
 .safe-terminal-view>.safe-hints-panel .value{height:24px}
 .safe-terminal-view>.safe-hints-panel .clue-table th{padding-top:4px;padding-bottom:4px}
 .safe-terminal-view>.safe-hints-panel .clue-table td{padding-top:1px!important;padding-bottom:1px!important}
 .safe-terminal-view>.safe-hints-panel .panel-foot{padding-top:3px;padding-bottom:3px}
 .safe-leaderboard-trigger{min-height:43px;margin-top:8px}
}
@media (max-width:620px){
 .safe-topbar{gap:5px}
 .safe-home-link{font-size:11px}
 .safe-controls-header{gap:6px}
 .status-tag#case-id{font-size:10px;letter-spacing:.015em}
 .safe-hints-trigger{min-height:40px}
 .safe-terminal-view>.safe-hints-panel .numbercode span{height:23px}
 .safe-terminal-view>.safe-hints-panel .value{height:23px}
 .leaderboard-dialog .leaderboard-section{grid-template-columns:1fr}
 .leaderboard-dialog .leaderboard-section .score-card{grid-column:auto}
 .leaderboard-dialog .leaderboard-section .mini-panel{padding:12px}
 .leaderboard-dialog .score-submit button{flex:1 1 100%}
}
@media (max-width:380px){
 .safe-engraving-symbol{display:none}
 .safe-topbar{padding-left:10px;padding-right:10px}
 .safe-right-meta{min-width:0}
 .safe-home-link{font-size:10px}
 .safe-lockstate{padding:5px 6px;letter-spacing:.03em}
 .safe-mechanics .safe-door-face{width:min(100%,104px)}
 .safe-hints-trigger{font-size:11px;padding:5px 7px}
 .safe-terminal-view>.safe-hints-panel .numbercode span{height:23px}
}
.shell{padding-bottom:max(35px,env(safe-area-inset-bottom,0px) + 24px)}

/* Keep hint toggle and the entire case strip exactly stable on narrow screens. */
@media(max-width:620px){.safe-hints-trigger{height:42px;min-height:42px}.safe-controls-header{min-height:42px}}

@media(max-width:360px){.safe-controls-header{min-height:48px}}
/* Remove surplus dead space in the combined keypad/clue viewport. */
@media(max-width:790px){
 .display-housing{min-height:82px;gap:6px}
 .segment-display{height:46px}
 .segment-display .seven-digit{height:43px}
 .safe-controls .error{min-height:17px;margin:3px 0 2px}
 .safe-keyboard-area{margin-top:4px}
}

.leaderboard-dialog .score-card[hidden]{display:none!important}

@media(max-width:620px) and (min-width:381px){.safe-mechanics .safe-door-face{width:min(100%,125px)}}


/* Tresor 09 / Mobile Design V3b: prominent main action, engraved case,
   inline lock state in chronometer, full-width hints toggle.
   No timing / score / puzzle logic changes. */
.safe-topbar{align-items:center}
.safe-right-meta{flex:0 0 auto}
.safe-engraving>div{gap:0}
.safe-home-link{display:inline-flex;align-items:center;min-height:38px}
/* The case mark is stamped into the metal beneath the physical vault wheel. */
.safe-case-engraving{
  display:block;align-self:center;max-width:100%;box-sizing:border-box;
  padding:7px 10px 5px;text-align:center;overflow-wrap:anywhere;
  font-size:clamp(9px,.9vw,12px);font-weight:900;letter-spacing:.08em;
  line-height:1.35;color:#222832;
  text-shadow:0 1px 0 #c8d0dc99,0 -1px 0 #0008;
  border:1px solid #151b2647;border-radius:5px;
  background:linear-gradient(150deg,#2b313ba0,#535b6677 54%,#2b323d99);
  box-shadow:inset 0 1px 2px #080c15b5,inset 0 -1px 1px #adb3bc42,0 1px 0 #9ba6b222;
}
/* Status is visually inside the time display, immediately below the numerals. */
.clock-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.clock-panel .safe-lockstate{
  display:inline-flex;justify-content:center;width:auto;max-width:100%;
  margin:1px 0 0;padding:3px 8px;font-size:10px;letter-spacing:.075em;
  background:#151a23b8;border-color:#59606b80;
}
.clock-panel #timer-status{display:block;text-align:center;font-size:11px;line-height:1.25;overflow-wrap:anywhere}
/* The only hints toggle occupies the full width previously used by the leaderboard. */
.safe-controls-header{display:block;width:100%;min-height:0;margin-bottom:8px}
.safe-controls-header .safe-hints-trigger{
  width:100%;max-width:none;display:flex;justify-content:center;gap:9px;
  margin:0;min-height:44px;border-radius:9px;font-size:13px;
}
.safe-controls-header .safe-hints-trigger[hidden]{display:none!important}
.safe-controls-header:has(.safe-hints-trigger[hidden]){display:none}
/* Ranking joins secondary actions; opening is the prominent full-width control. */
.safe-action-buttons{margin-top:10px}
.safe-action-buttons .safe-leaderboard-trigger{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:auto;margin:0;padding:9px 6px;min-height:48px;
  font-size:13px;font-weight:850;line-height:1.2;letter-spacing:0;
}
.safe-open-primary{
  display:block;width:100%;margin-top:10px;min-height:54px;
  font-size:16px;font-weight:900;letter-spacing:.035em;
  box-shadow:inset 0 1px #ffb5bb77,0 4px 0 #6b1d2a;
}
.safe-open-primary:disabled{box-shadow:none}
@media(max-width:790px){
 .safe-mechanics{grid-template-rows:auto auto auto}
 .safe-mechanics .safe-door-face{grid-column:1;grid-row:1}
 .safe-mechanics .clock-panel{grid-column:2;grid-row:1 / span 2}
 .safe-mechanics .safe-case-engraving{grid-column:1;grid-row:2}
 .safe-mechanics .treasure-chamber{grid-column:1/-1;grid-row:3}
 .safe-case-engraving{font-size:10px;letter-spacing:.025em;padding:5px 5px 4px}
 .clock-panel{padding:9px 8px}
 .clock-panel .safe-lockstate{font-size:9px;padding:3px 7px}
 .clock-panel #timer-status{font-size:10px}
 .safe-controls-header .safe-hints-trigger{min-height:44px;height:44px}
 .safe-open-primary{min-height:50px;font-size:15px}
}
@media(max-width:380px){
 .safe-home-link{font-size:11px}
 .safe-case-engraving{font-size:10px;letter-spacing:0;padding:5px 3px 4px}
 .safe-action-buttons .safe-leaderboard-trigger{font-size:11px;padding:7px 2px}
 .safe-open-primary{font-size:15px}
}


/* Tresor 09 / Single Safe Design V4 (15.11.2026)
 * Deliberately display only the safe: auxiliary panels have non-visual state hooks.
 * The clock and server timing logic remain unchanged.
 */
.tresor-runtime-support[hidden]{display:none!important}
.shell{padding-bottom:max(16px,env(safe-area-inset-bottom,0px) + 14px)}
.safe-stage{margin-bottom:0}
/* Title + naked case code on the same engraved header, no FALL prefix or badge. */
.safe-engraving{min-width:0}
.safe-engraving .safe-engraving-text{min-width:0;align-items:flex-start;gap:5px}
.safe-engraving .safe-case-engraving#case-id{
  display:block;align-self:flex-start;max-width:100%;margin:0;padding:0;
  background:none;border:0;box-shadow:none;border-radius:0;
  color:#9aa5b6;font:700 clamp(9px,.9vw,11px)/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.065em;text-align:left;overflow-wrap:anywhere;
  text-shadow:0 1px 0 #10151c,0 -1px 1px #68738455;
}
.safe-mechanics{gap:16px}
/* Neutral steel toggle: only the label is red. */
.safe-controls-header .safe-hints-trigger{
  background:linear-gradient(180deg,#242b35,#1b2029);
  border:1px solid #46515e;box-shadow:inset 0 1px 0 #ffffff1b;
  color:#ff8d96;text-shadow:0 0 8px #cc334433;
}
.safe-controls-header .safe-hints-trigger:hover:not(:disabled){
  background:linear-gradient(180deg,#303946,#212936);
  border-color:#596676;color:#ffabb1;
}
.safe-controls-header .safe-hints-trigger:focus-visible{outline:2px solid #ffa3a9;outline-offset:2px}
/* Fixed LCD envelope for empty code AND multi-part correctness feedback. */
.safe-controls .display-housing{
  height:101px;min-height:101px;max-height:101px;
  padding:7px 10px;display:flex;flex-direction:column;justify-content:center;
  align-items:stretch;gap:4px;
}
.safe-controls .segment-display{height:47px;min-height:47px;max-height:47px;flex:0 0 47px}
.safe-controls .segment-display .seven-digit{height:44px;max-height:50px}
.safe-controls .display-feedback{
  height:32px;min-height:32px;max-height:32px;flex:0 0 32px;
  display:grid;place-items:center;overflow:hidden;
  font-size:clamp(11px,1vw,12px);line-height:1.24;letter-spacing:.01em;
  text-align:center;overflow-wrap:anywhere;
}
/* The legacy .submit max-width (335px) must not constrain the desktop primary. */
.safe-controls #check-btn.safe-open-primary{display:block;max-width:none;width:100%;box-sizing:border-box}
@media(max-width:790px){
  .safe-mechanics{grid-template-rows:auto auto}
  .safe-mechanics .safe-door-face{grid-column:1;grid-row:1}
  .safe-mechanics .clock-panel{grid-column:2;grid-row:1}
  .safe-mechanics .treasure-chamber{grid-column:1/-1;grid-row:2}
  .safe-controls .display-housing{height:93px;min-height:93px;max-height:93px;padding:5px 7px;gap:3px}
  .safe-controls .segment-display{height:43px;min-height:43px;max-height:43px;flex-basis:43px}
  .safe-controls .segment-display .seven-digit{height:41px}
  .safe-controls .display-feedback{height:32px;min-height:32px;max-height:32px;flex-basis:32px;font-size:11px}
}
@media(max-width:380px){
  .safe-engraving .safe-case-engraving#case-id{font-size:9px;letter-spacing:.015em}
  .safe-engraving .safe-engraving-text{gap:4px}
  .safe-controls .display-feedback{font-size:10.5px}
}
/* Reserve the initially required status-line height on narrow phones; the
   first server-time update must not pull the rest of the safe upwards. */
@media(max-width:430px){.clock-panel #timer-status{min-height:2.5em;display:grid;place-items:center}}
@media(max-width:340px){.clock-panel #timer-status{min-height:3.75em}}


/* Tresor 09 / Win-in-place V5 – post-solve name entry in the physical terminal. */
.safe-win-panel{
  display:grid;justify-items:stretch;gap:12px;
  padding:clamp(17px,3vw,32px);min-height:330px;
  background:radial-gradient(ellipse at 45% 0%,#44341f50,transparent 64%),linear-gradient(165deg,#131a20,#0c1118);
  border:1px solid #a28a5880;border-radius:13px;
  box-shadow:inset 0 1px 0 #ffdf9a35,0 16px 38px #0007;
}
.safe-win-panel[hidden],.safe-terminal-view[hidden]{display:none!important}
.safe-win-panel h2{
  margin:2px 0 0;text-align:center;color:#ffda8b;
  font-size:clamp(19px,2.9vw,28px);letter-spacing:.09em;line-height:1.15;
  text-shadow:0 0 17px #d49a4a50;
}
.safe-win-panel #win-intro{margin:0;text-align:center;color:#c8cbd0;font-size:clamp(12px,1.4vw,14px);line-height:1.5}
.win-name-entry{display:grid;gap:10px}
.win-name-entry input{
  display:block;width:100%;min-width:0;min-height:52px;padding:12px 15px;
  background:linear-gradient(#1a242a,#263035);border:1px solid #b7a578;
  box-shadow:inset 0 2px 7px #000a,0 0 0 1px #ffecc11e;
  border-radius:11px;color:#fff;font-size:clamp(18px,2.5vw,26px);font-weight:650;
}
.win-name-entry input::placeholder{color:#a2a6ae;font-weight:450;font-size:clamp(14px,1.8vw,17px)}
.win-score-submit{display:block;width:100%;max-width:none;min-height:54px;font-size:clamp(15px,1.8vw,20px);font-weight:900}
.win-saved-name{display:grid;gap:4px;justify-items:center;text-align:center;color:#ffdda0}
.win-saved-name strong{font-size:clamp(22px,3vw,31px);overflow-wrap:anywhere;max-width:100%}
.win-saved-name span{font-size:12px;color:#ded0b2}
.win-saved-name .win-saved-check{font-size:28px;color:#ffd57c}
.win-score-feedback{margin:0;min-height:16px;text-align:center;color:#f0c17d;font-size:12px;line-height:1.35;overflow-wrap:anywhere}
.win-attempt-count{margin:0;text-align:center;font-size:13px;color:#bdc2c9;letter-spacing:.04em}
.safe-stage.is-open #hint-open-btn,
.safe-stage.is-open #check-btn,
.safe-stage.is-open #reveal-btn,
.safe-stage.is-open #result{display:none!important}
.safe-stage.is-open .safe-lockstate{color:#ffdc92;border-color:#b9944e99}
.safe-stage.is-open .safe-led{background:#fbd06f;box-shadow:0 0 10px #e5ae48bb}
@media(max-width:790px){
 .safe-win-panel{padding:18px 15px;min-height:280px;gap:10px}
 .win-name-entry input{min-height:48px}
 .win-score-submit{min-height:50px}
}
@media(max-width:380px){
 .safe-win-panel{padding:15px 12px;gap:8px}
 .safe-win-panel h2{font-size:18px;letter-spacing:.04em}
}

.safe-stage.is-open .vault-inner svg{stroke:#f5c76c;filter:drop-shadow(0 0 8px #f1ad5680)}


/* Tresor 09 V6 – keypad-adjacent hint toggle; keep the stable reserved terminal. */
.safe-entry-panel > .safe-controls-header{margin:8px 0 0;min-width:0}
.safe-entry-panel > .safe-controls-header .safe-hints-trigger{min-height:42px;height:42px}
.safe-hints-panel > .safe-controls-header{flex:0 0 auto;margin:0 0 4px;min-width:0}
.safe-hints-panel > .safe-controls-header .safe-hints-trigger{min-height:38px;height:38px}
/* The return control carries the visible label; avoid repeating the title/count
   and preserve the subtitle and readable table in the same viewport. */
.safe-hints-panel > .safe-hints-heading .safe-hints-titleline{display:none}
.safe-hints-panel > .safe-hints-heading{margin-bottom:1px}
.safe-entry-panel > .safe-controls-header:has(.safe-hints-trigger[hidden]),
.safe-hints-panel > .safe-controls-header:has(.safe-hints-trigger[hidden]){display:none}
/* Primary action above secondary controls on all widths. */
.safe-controls #check-btn.safe-open-primary{display:block;width:100%;max-width:none;margin-top:11px}
.safe-controls .safe-action-buttons{margin-top:10px}
.safe-footbar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.safe-footbar span:last-child{text-align:right;white-space:nowrap}
@media(max-width:380px){
  .safe-footbar{padding-left:9px;padding-right:9px;font-size:7px;letter-spacing:.015em}
  .safe-entry-panel > .safe-controls-header{margin-top:6px}
}


/* Tresor 09 / Mobile Refinement V7 (2026-11-16)
 * Presentation only; chronometer values, game state and controls are untouched.
 * The technical #timer-status remains in the DOM for existing JS but is
 * intentionally not displayed on smartphones.
 */
.safe-right-meta{flex-direction:column;align-items:flex-end;justify-content:center;gap:2px;flex-wrap:nowrap}
.safe-right-meta .safe-home-link{min-height:0;line-height:1.2}
.safe-brand-subtitle{font-size:10px;line-height:1.2;color:#aeb9c9;letter-spacing:.13em;font-weight:750;white-space:nowrap;text-align:right}
.safe-footbar{justify-content:flex-end}
.safe-footbar span{margin-left:auto;text-align:right;white-space:nowrap}
@media(max-width:620px){
  /* Shave excess status-line space without altering the time digits. */
  .clock-panel #timer-status{display:none!important;min-height:0!important;margin:0;padding:0}
  .clock-panel{min-height:72px;padding:7px 7px;gap:3px}
  /* Preserve the recognizable vault wheel, slightly smaller on phones. */
  .safe-mechanics .safe-door-face{width:113px}
  .safe-right-meta{gap:3px;min-width:0}
  .safe-brand-subtitle{font-size:9px;letter-spacing:.08em}
}
@media(max-width:380px){
  .safe-mechanics .safe-door-face{width:92px}
}
@media(max-width:360px){
  .safe-mechanics .safe-door-face{width:88px}
  .clock-panel{padding:6px 5px;min-height:70px}
  .safe-brand-subtitle{font-size:8px;letter-spacing:.055em}
}


/* Tresor 09 / Mobile Fit V8 (2026-11-16)
 * Keep the existing confirm-before-reveal handler and game JS. The reveal
 * action now shares the hint strip; the complete metal footer disappears.
 * Hint strip is moved as a unit between input and hint panel by existing JS.
 */
.safe-footbar{display:none!important}
.safe-entry-panel > .safe-controls-header,
.safe-hints-panel > .safe-controls-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(78px,0.34fr);
  align-items:stretch;gap:9px;
}
.safe-controls-header #hint-open-btn{
  grid-column:1;min-width:0;width:100%;margin:0;
}
.safe-controls-header #reveal-btn{
  grid-column:2;display:inline-flex;align-items:center;justify-content:center;
  min-width:0;width:100%;min-height:42px;height:42px;
  padding:6px 9px;border:1px solid #5d6675;border-radius:8px;
  background:linear-gradient(150deg,#242b35,#1b212b);
  color:#e4abb1;font-weight:800;font-size:12px;letter-spacing:.025em;
  line-height:1.15;text-decoration:none;
  box-shadow:inset 0 1px 0 #ffffff19,0 2px 5px #0006;
}
.safe-controls-header #reveal-btn:hover:not(:disabled),
.safe-controls-header #reveal-btn:focus-visible{color:#ffe1d3;border-color:#c28d95}
.safe-controls-header #reveal-btn:disabled{opacity:.4;cursor:not-allowed}
/* A blind puzzle has no hint toggle; keep the reveal action accessible. */
.safe-entry-panel > .safe-controls-header:has(#hint-open-btn[hidden]){display:grid}
.safe-controls-header:has(#hint-open-btn[hidden]) #reveal-btn{grid-column:1/-1}
/* Make the button-to-keypad separation slightly more generous than before. */
.safe-entry-panel .safe-keyboard-area{margin-top:12px}
.safe-stage.is-revealed .safe-controls-header #reveal-btn{display:none}
@media(max-width:790px){
  .safe-entry-panel > .safe-controls-header,
  .safe-hints-panel > .safe-controls-header{gap:7px}
  .safe-entry-panel .safe-keyboard-area{margin-top:12px}
}
@media(max-width:380px){
  .safe-controls-header #reveal-btn{font-size:11px;padding:4px 6px;min-height:44px;height:44px}
  .safe-entry-panel .safe-keyboard-area{margin-top:12px}
}


/* Tresor 09 / Solution-on-hints V9 (2026-11-16)
 * Standard puzzles: opening the hints swaps the primary action at the same
 * position from "Tresor öffnen" to "Lösung anzeigen". No extra button
 * competes for keypad/clock space. Existing JS/API reveal confirmation stays.
 * Blind puzzles: no clues panel exists, so retain an accessible give-up button.
 */
.safe-controls-header:has(#hint-open-btn:not([hidden])){
  display:block;grid-template-columns:none;
}
.safe-controls-header #hint-open-btn{
  display:block;grid-column:auto;width:100%;min-width:0;
}
.safe-controls #reveal-btn.safe-solution-primary{
  display:none;max-width:none;width:100%;box-sizing:border-box;
  margin:11px 0 0;min-height:54px;padding:11px 17px;
  font-size:15px;font-weight:850;
}
.safe-controls #reveal-btn.safe-solution-primary[hidden]{display:none!important}
/* Hint screen: the existing disabled primary is not shown, but its place is
   occupied by the reveal action. Leaving the button in the form preserves
   the pre-existing JS listener and the server-side reveal endpoint. */
.safe-controls:has(#safe-hints-panel:not([hidden])) #check-btn{display:none!important}
.safe-controls:has(#safe-hints-panel:not([hidden])) #reveal-btn.safe-solution-primary:not([hidden]){
  display:block;
}
/* Blind-mode escape hatch: an unsolved blind puzzle has no hints button. */
.safe-controls:has(#hint-open-btn[hidden]) #reveal-btn.safe-solution-primary:not([hidden]){
  display:block;
  background:linear-gradient(165deg,#2b2d37,#21242c);border-color:#65606b;
  color:#dfb7be;box-shadow:inset 0 1px 0 #ffffff10;
}
/* No reveal once the code was solved or explicitly given up. */
.safe-stage.is-open .safe-controls #reveal-btn.safe-solution-primary,
.safe-stage.is-revealed .safe-controls #reveal-btn.safe-solution-primary{
  display:none!important;
}
@media(max-width:790px){
  .safe-controls #reveal-btn.safe-solution-primary{min-height:50px;font-size:15px}
}


/* Tresor 09 V10 / Controlled spacing polish (mobile)
 * Keep existing source DOM/API, fixed LCD height, and hint/keypad viewport.
 * Error status remains available in a dedicated fixed line, avoiding jump.
 */
.safe-entry-panel > #input-error{
  min-height:12px;height:12px;line-height:12px;
  margin:0;padding:0;font-size:10px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.safe-entry-panel > .safe-controls-header{margin-top:0}
@media(max-width:790px){.safe-main{row-gap:10px}}
@media(max-width:620px){.safe-main{row-gap:8px}}


/* Tresor 09 V11 – viewport-aware wheel fitting and compact timer label.
 * The viewport fit uses visualViewport.height to accommodate mobile browser UI.
 * The game clock, score, keypad and hints remain unchanged.
 */
@media (max-width:620px){
  .safe-mechanics .safe-door-face{width:var(--nsd-tresor-wheel-fit,113px)}
  .clock-panel{min-height:58px;padding:5px 6px;gap:2px}
}
@media (max-width:380px){
  .safe-mechanics .safe-door-face{width:var(--nsd-tresor-wheel-fit,92px)}
}
@media (max-width:360px){
  .safe-mechanics .safe-door-face{width:var(--nsd-tresor-wheel-fit,88px)}
}


/* Tresor V12: network signal inside LCD. No additional vertical space. */
.display-housing .server-status-dot{position:absolute;z-index:5;left:11px;bottom:7px;
  width:7px;height:7px;border-radius:50%;pointer-events:none;
  background:#e6bb52;box-shadow:0 0 0 2px #151822,0 0 7px #e6bb5270;}
.server-status-dot[data-state="online"]{background:#50dc87;box-shadow:0 0 0 2px #151822,0 0 8px #50dc87aa;}
.server-status-dot[data-state="unavailable"]{background:#f06671;box-shadow:0 0 0 2px #151822,0 0 8px #f06671aa;}
.server-status-dot[data-state="offline"]{background:#eaaa50;box-shadow:0 0 0 2px #151822,0 0 8px #eaaa50aa;}
.display-housing .connection-message{position:absolute;z-index:3;left:12px;right:12px;top:15px;
  display:flex;align-items:center;justify-content:center;height:38px;
  color:#ffadb1;text-shadow:0 0 8px #8f2738a0;font-size:clamp(10px,2.4vw,14px);
  font-family:ui-monospace,SFMono-Regular,monospace;letter-spacing:.025em;font-weight:900;text-align:center;}
.display-housing .connection-message[hidden]{display:none!important;}
.safe-stage.is-server-blocked .segment-display{visibility:hidden;}
.safe-stage.is-server-blocked .display-feedback{color:#e0bd9b;font-size:clamp(10px,2vw,13px);}
.safe-stage.is-server-blocked #check-btn{background:linear-gradient(150deg,#524b4d,#343740);border-color:#8a8286;}
.safe-stage.is-server-blocked #hint-open-btn{color:#ffe1ae;border-color:#b08758;}

/* Tresor 09 V12a – single large status line, direct conscious offline primary.
 * No new rows and no changed LCD envelope/keyboard sizes. */
.safe-stage.is-server-blocked .display-housing .connection-message{
  inset:0;box-sizing:border-box;width:100%;height:100%;padding:8px 14px;
  font-size:clamp(16px,4.3vw,22px);line-height:1.15;letter-spacing:.015em;
  text-align:center;overflow-wrap:normal;
}
.safe-stage.is-server-blocked .display-feedback{visibility:hidden!important;}
.safe-stage.is-server-blocked #hint-toggle-row,
.safe-stage.is-server-blocked #hint-open-btn{display:none!important;}
.safe-stage.is-server-blocked #check-btn{
  background:linear-gradient(145deg,#8f6830,#6b431d);
  border-color:#b8904e;color:#fff4db;
}

/* Tresor 09 V13: time and attempt count share the existing third leaderboard column. */
.leader-row .leader-result{min-width:0;display:flex;flex-direction:column;align-items:flex-end;gap:1px;text-align:right;white-space:nowrap}
.leader-row .leader-attempts{color:#bcb7c1;font-size:11px;line-height:1.3;font-weight:500}
@media(max-width:400px){.leader-row .leader-result{font-variant-numeric:tabular-nums}.leader-row .leader-attempts{font-size:10px}}


/* Tresor 09 V14: subtle idle-clock hint glow. No transform or layout shifts.
   Activated by the real timer state, not by a fixed time or animation timer. */
@keyframes nsd-tresor-hint-breathe-v14{
  0%,100%{
    border-color:#46515e;
    color:#ff8d96;
    box-shadow:inset 0 1px 0 #ffffff1b,0 0 0 0 #ff7e9400;
    text-shadow:0 0 8px #cc334433;
  }
  50%{
    border-color:#b86b79;
    color:#ffb1b9;
    box-shadow:inset 0 1px 0 #ffffff26,0 0 0 1px #ff8da359,0 0 16px 2px #ec6a8938;
    text-shadow:0 0 12px #f7668b80;
  }
}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled){
  animation:nsd-tresor-hint-breathe-v14 3.6s ease-in-out infinite;
}
@media(prefers-reduced-motion:reduce){
  .safe-stage.is-hint-idle-v14 #hint-open-btn{animation:none!important;}
}


/* Tresor 09 V15: three inward-running hint arrows on EACH side.
 * The original V14 idle-clock class controls the animation (single source
 * of truth). No movement, size change or extra row on the mobile safe. */
.safe-controls-header #hint-open-btn.safe-hints-trigger{
  display:flex;align-items:center;justify-content:center;
  gap:clamp(3px, .8vw, 9px);
  min-width:0;overflow:hidden;
  padding-left:5px;padding-right:5px;
}
#hint-open-btn .hint-button-content{
  display:inline-flex;align-items:center;justify-content:center;
  gap:7px;flex:0 1 auto;min-width:0;white-space:nowrap;
  font-size:clamp(12px, 3.4vw, 18px);
}
#hint-open-btn .hint-button-content .hints-icon{
  flex:none;line-height:1;
}
#hint-open-btn .hint-runway{
  display:inline-flex;gap:0;align-items:center;
  flex:0 0 auto;min-width:0;
  font:900 clamp(11px, 2.8vw, 18px)/1 ui-sans-serif,system-ui,sans-serif;
  letter-spacing:-.12em;
  white-space:nowrap;
}
#hint-open-btn .hint-runway .hint-arrow{
  display:inline-block;
  color:#c66e80;opacity:.32;
  text-shadow:none;
  animation:none;
}
/* Left: outside -> center (1,2,3); right: outside -> center (3,2,1). */
@keyframes nsd-tresor-hint-runway-v15{
  0%,6%,32%,100%{color:#b45c70;opacity:.28;text-shadow:none;}
  11%,19%{color:#ffe7d0;opacity:1;text-shadow:0 0 7px #ff91b0,0 0 13px #ff557b;}
}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked)
  #hint-open-btn:not([hidden]):not(:disabled) .hint-runway .hint-arrow{
  animation:nsd-tresor-hint-runway-v15 2.7s ease-in-out infinite;
}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(1),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(3){animation-delay:0s}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(2),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(2){animation-delay:.22s}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(3),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(1){animation-delay:.44s}
@media(max-width:360px){
  #hint-open-btn .hint-button-content{gap:5px;font-size:12px}
  #hint-open-btn .hint-runway{font-size:11px;letter-spacing:-.2em}
  .safe-controls-header #hint-open-btn.safe-hints-trigger{gap:3px;padding-left:4px;padding-right:4px}
}
@media(prefers-reduced-motion:reduce){
  .safe-stage.is-hint-idle-v14 #hint-open-btn .hint-runway .hint-arrow{
    animation:none!important;color:#ffb3c0;opacity:.8;
  }
}


/* Tresor 09 V16: ONE shared 3.6-second cycle, deliberately alternating light:
 * phase A: three arrow pairs light outside -> inside with dark button,
 * phase B: arrows dark, the button face glows. The V14 timer guard remains
 * the sole enable condition; no JavaScript/clock changes, no size shifts. */
@keyframes nsd-tresor-hint-button-alternate-v16{
  0%,44%,100%{
    border-color:#46515e;color:#ff8d96;
    box-shadow:inset 0 1px 0 #ffffff1b,0 0 0 0 #ff7e9400;
    text-shadow:0 0 8px #cc334433;
  }
  54%,70%{
    border-color:#de8294;color:#ffe5de;
    box-shadow:inset 0 1px 0 #ffffff3d,0 0 0 1px #ff9bb784,0 0 20px 3px #f568925b;
    text-shadow:0 0 13px #ff91adab;
  }
  86%{
    border-color:#46515e;color:#ff8d96;
    box-shadow:inset 0 1px 0 #ffffff1b,0 0 0 0 #ff7e9400;
    text-shadow:0 0 8px #cc334433;
  }
}
@keyframes nsd-tresor-hint-arrow-outer-v16{
  0%,4%,21%,100%{color:#b45c70;opacity:.24;text-shadow:none}
  9%,15%{color:#ffe9e1;opacity:1;text-shadow:0 0 8px #ffaac5,0 0 14px #ff5c82}
}
@keyframes nsd-tresor-hint-arrow-middle-v16{
  0%,14%,31%,100%{color:#b45c70;opacity:.24;text-shadow:none}
  19%,25%{color:#ffe9e1;opacity:1;text-shadow:0 0 8px #ffaac5,0 0 14px #ff5c82}
}
@keyframes nsd-tresor-hint-arrow-inner-v16{
  0%,24%,41%,100%{color:#b45c70;opacity:.24;text-shadow:none}
  29%,35%{color:#ffe9e1;opacity:1;text-shadow:0 0 8px #ffaac5,0 0 14px #ff5c82}
}
/* Button is deliberately dark while arrow pairs run (0–41%). */
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled){
  animation:nsd-tresor-hint-button-alternate-v16 3.6s linear infinite;
}
/* Increase only the arrow glyphs by ~2px, not the surrounding button. */
#hint-open-btn .hint-runway{font-size:clamp(14px,3.5vw,21px)}
/* Use the V15 selectors with equal specificity, declared later: the new
 * animation shorthand resets the old per-arrow animation-delay to zero. */
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(1),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(3){
  animation:nsd-tresor-hint-arrow-outer-v16 3.6s linear infinite;
}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(2),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(2){
  animation:nsd-tresor-hint-arrow-middle-v16 3.6s linear infinite;
}
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-left .hint-arrow:nth-child(3),
.safe-stage.is-hint-idle-v14:not(.is-server-blocked) #hint-open-btn:not([hidden]):not(:disabled) .hint-runway-right .hint-arrow:nth-child(1){
  animation:nsd-tresor-hint-arrow-inner-v16 3.6s linear infinite;
}
@media(max-width:360px){
  #hint-open-btn .hint-runway{font-size:13px;letter-spacing:-.18em}
}
@media(prefers-reduced-motion:reduce){
  .safe-stage.is-hint-idle-v14 #hint-open-btn{animation:none!important}
  .safe-stage.is-hint-idle-v14 #hint-open-btn .hint-runway .hint-arrow{animation:none!important}
}

/* Tresor 09 V17: modal-only board tabs, without changing the safe height. */
.tresor-board-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:14px 0 8px}
.tresor-board-tabs button{min-height:44px;border:1px solid #685863;border-radius:10px;background:#24222b;color:#e5d7d9;font-size:clamp(11px,2.5vw,14px);font-weight:650;padding:7px 5px;cursor:pointer}
.tresor-board-tabs button[aria-selected="true"]{background:#4e343d;border-color:#e2a975;color:#fff5df;box-shadow:inset 0 -2px #d49b61}
.tresor-board-tabs button:focus-visible{outline:3px solid #ffdaa1;outline-offset:2px}
.leaderboard-dialog .leaderboard-section{display:block;margin-top:8px}
.leaderboard-dialog .tresor-board-panel[hidden],.leaderboard-dialog #archive-detail[hidden],.leaderboard-dialog #archive-more[hidden]{display:none!important}
.leaderboard-dialog .tresor-board-panel>.mini-panel{margin-bottom:12px}
.tresor-stat-line{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border-bottom:1px solid #3a3640;padding:8px 0;color:#c9c4cd;font-size:13px}
.tresor-stat-line strong{color:#ffdfa9;font-variant-numeric:tabular-nums;white-space:nowrap}
.tresor-stat-note,.tresor-archive-note{font-size:12px;line-height:1.45;color:#afa9b2;margin:12px 0 0}
.tresor-archive-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:10px 0 14px}
.tresor-archive-filters label{font-size:12px;color:#dad2d4;display:flex;flex-direction:column;gap:5px}
.tresor-archive-filters select{width:100%;min-height:43px;border-radius:8px;background:#29252b;color:#fff;border:1px solid #77606a;padding:8px}
.tresor-archive-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tresor-archive-card{background:#1d1d25;border:1px solid #4b4148;padding:13px;border-radius:11px;min-width:0}
.tresor-archive-card>strong{color:#ffdaa5;font-size:14px;overflow-wrap:anywhere}
.tresor-archive-card p{font-size:12px;color:#bdb8c1;margin:7px 0}
.tresor-archive-card .tresor-archive-state{color:#f3d4a8;min-height:2em}
.tresor-archive-actions{display:flex;flex-wrap:wrap;gap:7px}
.tresor-archive-actions .button{display:inline-flex;align-items:center;justify-content:center;flex:1 1 120px;min-height:42px;padding:7px;text-align:center;font-size:12px;text-decoration:none}
#archive-more{width:100%;min-height:44px;margin-top:12px}
.tresor-archive-detail{margin-top:13px}
@media(max-width:540px){.tresor-archive-list{grid-template-columns:1fr}.tresor-board-tabs button{font-size:11px;line-height:1.2}}

.tresor-archive-search{margin-bottom:13px;display:flex;flex-direction:column;gap:5px;font-size:12px;color:#dad2d4}
.tresor-archive-search>div{display:flex;gap:7px}
.tresor-archive-search input{min-width:0;flex:1;background:#26232b;color:#fff;border:1px solid #77606a;border-radius:8px;padding:9px;min-height:43px}
.tresor-archive-search button{min-height:43px}


/* Tresor 09 V18: a clear connected tab bar, compact statistics and inline case list.
   This only affects the leaderboard modal. The safe itself has no new geometry. */
.leaderboard-dialog .tresor-board-tabs{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;
  margin:15px 0 0;border:1px solid #665460;border-bottom:3px solid #ca9567;
  border-radius:12px 12px 0 0;overflow:hidden;background:#17171f;
}
.leaderboard-dialog .tresor-board-tabs button{
  border:0;border-right:1px solid #4d4049;border-radius:0;
  min-height:48px;padding:7px 5px;background:#25232b;color:#bfb9c2;
  font-size:clamp(10px,2.5vw,13px);font-weight:700;line-height:1.22;
  box-shadow:none;outline-offset:-3px;
}
.leaderboard-dialog .tresor-board-tabs button:last-child{border-right:0}
.leaderboard-dialog .tresor-board-tabs button[aria-selected="true"]{
  background:linear-gradient(180deg,#73505a,#583a45);
  color:#fff0d3;box-shadow:inset 0 3px #ffd79c;
}
.leaderboard-dialog .tresor-board-tabs button:not([aria-selected="true"]):hover{background:#363039;color:#fff0e5}
.leaderboard-dialog .tresor-board-panel{
  border:1px solid #665460;border-top:0;border-radius:0 0 12px 12px;
  padding:clamp(9px,2vw,15px);background:#191a21;
}
.leaderboard-dialog .leaderboard-section{margin-top:0}
.leaderboard-dialog .tresor-board-panel>.mini-panel{
  padding:clamp(12px,2.5vw,17px);margin-bottom:9px;border-radius:12px;
  background:#1c1d25;
}
.leaderboard-dialog .tresor-board-panel>.mini-panel:last-child{margin-bottom:0}
.leaderboard-dialog .tresor-statistics h2{font-size:14px!important;margin-bottom:6px!important;color:#ebd5b4}
.leaderboard-dialog .tresor-stat-line{padding:9px 0;font-size:13px}
.leaderboard-dialog .tresor-stat-line:last-child{border-bottom:none;padding-bottom:0}
.leaderboard-dialog .tresor-archive-filters{display:flex;justify-content:flex-end;margin:0 0 10px;gap:0}
.leaderboard-dialog .tresor-archive-filters label{
  display:flex;flex-direction:row;align-items:center;gap:9px;color:#bfb8c4;font-size:12px;
}
.leaderboard-dialog .tresor-archive-filters select{
  min-height:38px;width:auto;max-width:210px;border-radius:8px;padding:5px 25px 5px 9px;
}
.leaderboard-dialog .tresor-archive-list{display:grid;grid-template-columns:1fr;gap:7px}
.leaderboard-dialog .tresor-archive-card{
  padding:0;border:1px solid #4d434e;background:#1f2029;
  border-radius:10px;overflow:hidden;
}
.leaderboard-dialog .tresor-archive-toggle{
  display:flex;width:100%;align-items:center;justify-content:space-between;
  gap:8px;text-align:left;background:none;color:#f4dfb8;border:0;
  padding:11px 13px;cursor:pointer;min-height:57px;
}
.leaderboard-dialog .tresor-archive-toggle:hover,.leaderboard-dialog .tresor-archive-toggle[aria-expanded="true"]{background:#322934}
.leaderboard-dialog .tresor-archive-toggle:focus-visible{outline:3px solid #f4c88c;outline-offset:-4px}
.leaderboard-dialog .tresor-archive-summary{display:flex;flex-direction:column;gap:3px;min-width:0}
.leaderboard-dialog .tresor-archive-summary strong{
  font-size:clamp(12px,3.3vw,15px);line-height:1.3;overflow-wrap:anywhere;
  color:#ffe0af;letter-spacing:.02em;
}
.leaderboard-dialog .tresor-archive-summary>span{font-size:11px;color:#c3bdc6;line-height:1.4}
.leaderboard-dialog .tresor-archive-chevron{
  font-size:33px;line-height:1;color:#ffcf93;flex:0 0 24px;
  text-align:center;transform:rotate(0);transition:transform .2s ease;
}
.leaderboard-dialog .tresor-archive-toggle[aria-expanded="true"] .tresor-archive-chevron{transform:rotate(90deg)}
.leaderboard-dialog .tresor-archive-expanded{
  padding:12px 13px 14px;border-top:1px solid #594b55;
  background:#181921;
}
.leaderboard-dialog .tresor-archive-expanded[hidden]{display:none!important}
.leaderboard-dialog .tresor-archive-expanded .leaders{max-height:27dvh;overflow-y:auto;margin:0 0 12px}
.leaderboard-dialog .tresor-archive-expanded>a.button{
  display:flex;min-height:43px;align-items:center;justify-content:center;
  width:100%;text-align:center;text-decoration:none;font-weight:800;
}
@media(prefers-reduced-motion:reduce){
  .leaderboard-dialog .tresor-archive-chevron{transition:none}
}

/* Tresor 09 V19: fixed leaderboard viewport, stable tabs, compact row metrics.
   Only the leaderboard dialog is affected; the safe dimensions are untouched. */
.leaderboard-dialog{
  height:min(720px,calc(100dvh - 24px));
  max-height:min(90dvh,900px);overflow:hidden;
}
.leaderboard-dialog .leaderboard-dialog-content{
  display:flex;flex-direction:column;height:100%;min-height:0;
}
.leaderboard-dialog .dialog-head{flex:0 0 32px;justify-content:flex-end}
.leaderboard-dialog .dialog-head .dialog-x{min-width:36px;min-height:32px}
.leaderboard-dialog .tresor-board-tabs{flex:0 0 auto;margin:7px 0 0}
.leaderboard-dialog .leaderboard-section{
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.leaderboard-dialog .tresor-board-panel{min-height:100%;}
.leaderboard-dialog .tresor-board-heading{
  font-size:clamp(17px,3.2vw,20px);font-weight:750;
  line-height:1.25;margin:0 0 12px;color:#ffe1ae;
}
.leaderboard-dialog .tresor-board-toolbar{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:8px 12px;margin-bottom:12px;
}
.leaderboard-dialog .tresor-board-toolbar .tresor-board-heading{margin:0}
.leaderboard-dialog .tresor-board-select,
.leaderboard-dialog .tresor-archive-filters label{
  display:flex;flex-direction:row;align-items:center;gap:7px;
  color:#c5bec9;font-size:12px;
}
.leaderboard-dialog .tresor-board-select select,
.leaderboard-dialog .tresor-archive-filters select{
  width:auto;max-width:190px;min-height:38px;
  background:#29252b;color:#fff;border:1px solid #77606a;
  border-radius:8px;padding:5px 24px 5px 8px;
}
.leaderboard-dialog .tresor-archive-filters{margin:0}
.leaderboard-dialog .tresor-statistics{
  padding:8px!important;margin-bottom:9px!important;
}
.leaderboard-dialog .tresor-stat-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;
}
.leaderboard-dialog .tresor-stat-grid .tresor-stat-line{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-width:0;gap:3px;text-align:center;
  padding:7px 3px!important;border:1px solid #46404a!important;
  border-radius:8px;background:#25242e;font-size:11px;
}
.leaderboard-dialog .tresor-stat-grid .tresor-stat-line span{white-space:nowrap;}
.leaderboard-dialog .tresor-stat-grid .tresor-stat-line strong{
  color:#ffdfa9;font-size:clamp(12px,2.8vw,15px);line-height:1.25;
  font-variant-numeric:tabular-nums;
}
.leaderboard-dialog .tresor-archive-summary>span{
  font-size:clamp(12.5px,2.9vw,14px);line-height:1.45;
  color:#e1d5da;
}
@media(max-width:380px){
  .leaderboard-dialog .tresor-board-select,
  .leaderboard-dialog .tresor-archive-filters label{font-size:11px;gap:5px}
  .leaderboard-dialog .tresor-board-select select,
  .leaderboard-dialog .tresor-archive-filters select{max-width:160px;min-height:36px;padding-left:5px}
  .leaderboard-dialog .tresor-stat-grid{gap:4px}
  .leaderboard-dialog .tresor-stat-grid .tresor-stat-line{font-size:10.5px}
}

/* Tresor 09 V20: identical heading start and header-row height in all tabs.
   The difficulty filters keep their existing appearance and behavior. */
.leaderboard-dialog .tresor-board-panel > .tresor-board-toolbar {
  min-height:38px;
  align-items:flex-start;
}

/* Tresor 09 V21: visible leaderboard title and equal tab/content width.
   Both tab wrapper and scrolling content reserve the browser's native scrollbar
   gutter. This keeps the three-tab strip attached to the content panel. */
.leaderboard-dialog .dialog-head {
  justify-content:space-between;
}
.leaderboard-dialog .tresor-board-tabs-viewport {
  flex:0 0 auto;
  min-width:0;
  overflow-y:auto;
  scrollbar-gutter:stable;
}
.leaderboard-dialog .tresor-board-tabs-viewport .tresor-board-tabs {
  margin-top:7px;
}


/* Tresor 09 V22 – new safe tabs and relocated archive. Only the two dialogs. */
.leaderboard-dialog .tresor-board-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
.leaderboard-dialog .tresor-board-trophy{
  color:#d9a34e;font-size:1em;line-height:1;vertical-align:baseline;
  white-space:nowrap;
}
.new-case-dialog{
  width:min(730px,calc(100vw - 20px));
  height:min(720px,calc(100dvh - 24px));
  max-height:min(90dvh,900px);overflow:hidden;
}
.new-case-dialog .new-case-content{
  display:flex;flex-direction:column;height:100%;min-height:0;
  padding:clamp(13px,3vw,24px);gap:0;
}
.new-case-dialog .dialog-head{flex:0 0 32px;align-items:center;justify-content:space-between}
.new-case-dialog .tresor-board-tabs-viewport{
  flex:0 0 auto;min-width:0;overflow-y:auto;scrollbar-gutter:stable;
}
.new-case-dialog .tresor-board-tabs{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;
  margin:7px 0 0;border:1px solid #665460;border-bottom:3px solid #ca9567;
  border-radius:12px 12px 0 0;overflow:hidden;background:#17171f;
}
.new-case-dialog .tresor-board-tabs button{
  border:0;border-right:1px solid #4d4049;border-radius:0;
  min-height:48px;padding:7px 5px;background:#25232b;color:#bfb9c2;
  font-size:clamp(11px,2.5vw,13px);font-weight:700;line-height:1.22;
  box-shadow:none;outline-offset:-3px;
}
.new-case-dialog .tresor-board-tabs button:last-child{border-right:0}
.new-case-dialog .tresor-board-tabs button[aria-selected="true"]{
  background:linear-gradient(180deg,#73505a,#583a45);color:#fff0d3;
  box-shadow:inset 0 3px #ffd79c;
}
.new-case-dialog .tresor-board-tabs button:not([aria-selected="true"]):hover{background:#363039;color:#fff0e5}
.new-case-dialog .tresor-new-panels{
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.new-case-dialog .tresor-new-panel{
  min-height:100%;border:1px solid #665460;border-top:0;
  border-radius:0 0 12px 12px;padding:clamp(9px,2vw,15px);background:#191a21;
}
.new-case-dialog .tresor-new-panel[hidden]{display:none!important}
.new-case-dialog .tresor-board-heading{
  font-size:clamp(17px,3.2vw,20px);font-weight:750;line-height:1.25;
  margin:0;color:#ffe1ae;
}
.new-case-dialog .tresor-board-toolbar{
  display:flex;align-items:flex-start;justify-content:space-between;
  flex-wrap:wrap;gap:8px 12px;min-height:38px;margin-bottom:12px;
}
.new-case-dialog .tresor-new-generate-form{
  display:flex;flex-direction:column;gap:14px;max-width:500px;
}
.new-case-dialog .tresor-new-generate-form p{margin:0;color:#c8c2cb;font-size:14px;line-height:1.6}
.new-case-dialog .tresor-new-generate-form .setting-label{font-weight:750}
.new-case-dialog .tresor-new-generate-form .choose{width:100%;min-height:48px}
.new-case-dialog .tresor-archive-filters{display:flex;justify-content:flex-end;margin:0;gap:0}
.new-case-dialog .tresor-archive-filters label{
  display:flex;flex-direction:row;align-items:center;gap:9px;color:#bfb8c4;font-size:12px;
}
.new-case-dialog .tresor-archive-filters select{
  min-height:38px;width:auto;max-width:210px;border-radius:8px;
  background:#29252b;color:#fff;border:1px solid #77606a;padding:5px 25px 5px 9px;
}
.new-case-dialog .tresor-archive-list{display:grid;grid-template-columns:1fr;gap:7px}
.new-case-dialog .tresor-archive-card{
  padding:0;border:1px solid #4d434e;background:#1f2029;
  border-radius:10px;overflow:hidden;
}
.new-case-dialog .tresor-archive-toggle{
  display:flex;width:100%;align-items:center;justify-content:space-between;
  gap:8px;text-align:left;background:none;color:#f4dfb8;border:0;
  padding:11px 13px;cursor:pointer;min-height:57px;
}
.new-case-dialog .tresor-archive-toggle:hover,
.new-case-dialog .tresor-archive-toggle[aria-expanded="true"]{background:#322934}
.new-case-dialog .tresor-archive-toggle:focus-visible{outline:3px solid #f4c88c;outline-offset:-4px}
.new-case-dialog .tresor-archive-summary{display:flex;flex-direction:column;gap:3px;min-width:0}
.new-case-dialog .tresor-archive-summary strong{
  font-size:clamp(12px,3.3vw,15px);line-height:1.3;overflow-wrap:anywhere;
  color:#ffe0af;letter-spacing:.02em;
}
.new-case-dialog .tresor-archive-summary>span{
  font-size:clamp(12.5px,2.9vw,14px);line-height:1.45;color:#e1d5da;
}
.new-case-dialog .tresor-archive-chevron{
  font-size:33px;line-height:1;color:#ffcf93;flex:0 0 24px;
  text-align:center;transform:rotate(0);transition:transform .2s ease;
}
.new-case-dialog .tresor-archive-toggle[aria-expanded="true"] .tresor-archive-chevron{transform:rotate(90deg)}
.new-case-dialog .tresor-archive-expanded{
  padding:12px 13px 14px;border-top:1px solid #594b55;background:#181921;
}
.new-case-dialog .tresor-archive-expanded[hidden]{display:none!important}
.new-case-dialog .tresor-archive-expanded .leaders{
  max-height:27dvh;overflow-y:auto;margin:0 0 12px;
}
.new-case-dialog .tresor-archive-expanded>a.button{
  display:flex;min-height:43px;align-items:center;justify-content:center;
  width:100%;text-align:center;text-decoration:none;font-weight:800;
}
@media(max-width:380px){
  .new-case-dialog .tresor-archive-filters label{font-size:11px;gap:5px}
  .new-case-dialog .tresor-archive-filters select{max-width:160px;min-height:36px;padding-left:5px}
}
@media(prefers-reduced-motion:reduce){
  .new-case-dialog .tresor-archive-chevron{transition:none}
}

/* Tresor 09 V22a – outer leaderboard frame matches the New Tresor frame. */
.leaderboard-dialog{border-color:#a15464}


/* TRESOR 09 V25 / SEVEN-SEGMENT STOPWATCH
 * Presentation only: keep the existing timer frame, placement and clock logic.
 * Match the angular red LED segments in the code-entry panel.
 */
.clock-panel #timer-value.timer-seven-active{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:clamp(2px,.35vw,5px);
  max-width:100%;
  min-height:clamp(31px,3.3vw,44px);
  font-size:0;
  line-height:1;
  letter-spacing:0;
  white-space:nowrap;
  filter:drop-shadow(0 0 4px #ef514555);
}
.clock-panel #timer-value .timer-seven-digit{
  display:block;
  position:relative;
  flex:0 0 auto;
  width:clamp(17px,2.1vw,26px);
  height:clamp(31px,3.3vw,44px);
}
.clock-panel #timer-value .timer-seven-digit .seg{
  opacity:.32;
  background:#582d31;
  box-shadow:none;
}
.clock-panel #timer-value .timer-seven-digit .seg.lit{
  opacity:1;
  background:#ff746e;
  box-shadow:0 0 7px #fb494991,0 0 2px #ffb5ab;
}
.clock-panel #timer-value .timer-seven-colon{
  position:relative;
  display:block;
  flex:0 0 auto;
  width:clamp(5px,.65vw,8px);
  height:clamp(31px,3.3vw,44px);
}
.clock-panel #timer-value .timer-seven-colon::before,
.clock-panel #timer-value .timer-seven-colon::after{
  content:'';
  position:absolute;
  left:50%;
  width:clamp(4px,.45vw,6px);
  height:clamp(4px,.45vw,6px);
  transform:translateX(-50%);
  border-radius:1px;
  background:#ff746e;
  box-shadow:0 0 6px #ff48488c;
}
.clock-panel #timer-value .timer-seven-colon::before{top:31%}
.clock-panel #timer-value .timer-seven-colon::after{bottom:31%}


/* TRESOR 09 V26 – presentation only: no outline around clock lock label,
 * two red illuminated metal rings around the vault wheel.
 * Keep wheel geometry, status LED, states and animation unchanged. */
.clock-panel .safe-lockstate{border:0}
.safe-mechanics .safe-door-face{
  box-shadow:0 0 0 2px #ff606880,
             0 0 0 7px #20242d,
             0 0 0 10px #db364580,
             0 0 13px 11px #ee354927,
             0 16px 23px #0304079c,
             inset 0 0 0 5px #161c25,
             inset 0 0 0 12px #737d8a88,
             inset 0 8px 20px #080b14;
}
@media (max-width:620px){
  .safe-mechanics .safe-door-face{
    box-shadow:0 0 0 2px #ff606880,
               0 0 0 4px #20242d,
               0 0 0 6px #db364580,
               0 0 10px 7px #ee35492b,
               0 7px 16px #0304079c,
               inset 0 0 0 5px #161c25;
  }
}


/* TRESOR 09 V27 – unlock confirmation: the OUTER red ring becomes green first;
 * 150ms later, the INNER ring follows. The current V26b red intensity,
 * wheel dimensions, and gold celebration remain unchanged.
 * is-open is assigned only for app.won; is-revealed never triggers green. */
@keyframes nsd-v27-ring-unlock-desktop {
  0% {
    box-shadow:0 0 0 2px #ff606880,
               0 0 0 7px #20242d,
               0 0 0 10px #db364580,
               0 0 13px 11px #ee354927,
               0 16px 23px #0304079c,
               inset 0 0 0 5px #161c25,
               inset 0 0 0 12px #737d8a88,
               inset 0 8px 20px #080b14;
  }
  42.857% { /* t = 150 ms: outer ring is green, inner stays red */
    box-shadow:0 0 0 2px #ff606880,
               0 0 0 7px #20242d,
               0 0 0 10px #39d68b80,
               0 0 13px 11px #26c47a27,
               0 16px 23px #0304079c,
               inset 0 0 0 5px #161c25,
               inset 0 0 0 12px #737d8a88,
               inset 0 8px 20px #080b14;
  }
  100% {
    box-shadow:0 0 0 2px #63efa680,
               0 0 0 7px #20242d,
               0 0 0 10px #39d68b80,
               0 0 13px 11px #26c47a27,
               0 16px 23px #0304079c,
               inset 0 0 0 5px #161c25,
               inset 0 0 0 12px #737d8a88,
               inset 0 8px 20px #080b14;
  }
}
@keyframes nsd-v27-ring-unlock-mobile {
  0% {
    box-shadow:0 0 0 2px #ff606880,
               0 0 0 4px #20242d,
               0 0 0 6px #db364580,
               0 0 10px 7px #ee35492b,
               0 7px 16px #0304079c,
               inset 0 0 0 5px #161c25;
  }
  42.857% { /* t = 150 ms: outer ring is green, inner stays red */
    box-shadow:0 0 0 2px #ff606880,
               0 0 0 4px #20242d,
               0 0 0 6px #39d68b80,
               0 0 10px 7px #26c47a2b,
               0 7px 16px #0304079c,
               inset 0 0 0 5px #161c25;
  }
  100% {
    box-shadow:0 0 0 2px #63efa680,
               0 0 0 4px #20242d,
               0 0 0 6px #39d68b80,
               0 0 10px 7px #26c47a2b,
               0 7px 16px #0304079c,
               inset 0 0 0 5px #161c25;
  }
}
/* A successful win is already exposed as .is-open by the V26b JavaScript.
 * Keep the existing golden unlock effect independently as the second animation. */
.safe-stage.is-open .safe-mechanics .safe-door-face {
  animation:nsd-v27-ring-unlock-desktop 350ms linear both;
}
.safe-stage.is-open.is-celebrating .safe-mechanics .safe-door-face {
  animation:nsd-v27-ring-unlock-desktop 350ms linear both, nsd-safe-glow 2.8s ease-out 1;
}
@media(max-width:620px) {
  .safe-stage.is-open .safe-mechanics .safe-door-face {
    animation-name:nsd-v27-ring-unlock-mobile;
  }
  .safe-stage.is-open.is-celebrating .safe-mechanics .safe-door-face {
    animation-name:nsd-v27-ring-unlock-mobile, nsd-safe-glow;
  }
}
@media(prefers-reduced-motion:reduce) {
  /* Instant green with no transition; remain green after win reload/resume. */
  .safe-stage.is-open .safe-mechanics .safe-door-face,
  .safe-stage.is-open.is-celebrating .safe-mechanics .safe-door-face {
    animation:none!important;
    box-shadow:0 0 0 2px #63efa680,
               0 0 0 7px #20242d,
               0 0 0 10px #39d68b80,
               0 0 13px 11px #26c47a27,
               0 16px 23px #0304079c,
               inset 0 0 0 5px #161c25,
               inset 0 0 0 12px #737d8a88,
               inset 0 8px 20px #080b14;
  }
}
@media(max-width:620px) and (prefers-reduced-motion:reduce) {
  .safe-stage.is-open .safe-mechanics .safe-door-face,
  .safe-stage.is-open.is-celebrating .safe-mechanics .safe-door-face {
    box-shadow:0 0 0 2px #63efa680,
               0 0 0 4px #20242d,
               0 0 0 6px #39d68b80,
               0 0 10px 7px #26c47a2b,
               0 7px 16px #0304079c,
               inset 0 0 0 5px #161c25;
  }
}

/* Tresor 09 V29: dialog outer borders use the safe's metallic border tone.
   Scope: border color only; tabs, backgrounds, buttons and game unchanged. */
.leaderboard-dialog,
.new-case-dialog {
  border-color: #69717d;
}

/* Tresor 09 V30: on the physical delete key, disable double-tap zoom only.
   Browser pinch zoom and normal page scrolling stay available. */
.safe-keyboard-area #back-key {
  touch-action: manipulation;
}

/* Tresor 09 V30: increase clue digits on desktop, not on narrow layouts.
   Do not alter hint boxes, table columns, row height or any game logic. */
@media (min-width: 791px) {
  .safe-terminal-view > .safe-hints-panel .clue-table .numbercode span { font-size: 18px; }
  .safe-terminal-view > .safe-hints-panel .clue-table .value { font-size: 18px; }
}


/* Tresor 09 V31 – the leaderboard and new-safe dialogs fill the visible screen.
   Visual-only: preserve tabs, content and their independent scroll containers.
   Do not change the share dialog or the game itself. */
dialog.leaderboard-dialog,
dialog.new-case-dialog {
  position:fixed;
  inset:0;
  margin:0;
  box-sizing:border-box;
  width:100vw;
  max-width:100vw;
  height:100vh; /* fallback for browsers without dynamic viewport units */
  height:100dvh;
  max-height:100dvh;
  border-radius:0;
  padding:0;
  overflow:hidden;
}
.leaderboard-dialog .leaderboard-dialog-content,
.new-case-dialog .new-case-content {
  width:100%;
  height:100%;
  min-height:0;
  box-sizing:border-box;
  padding-top:max(clamp(12px,2.2vw,26px),env(safe-area-inset-top,0px));
  padding-right:max(clamp(12px,2.2vw,26px),env(safe-area-inset-right,0px));
  padding-bottom:max(clamp(12px,2.2vw,26px),env(safe-area-inset-bottom,0px));
  padding-left:max(clamp(12px,2.2vw,26px),env(safe-area-inset-left,0px));
}
.leaderboard-dialog .dialog-head,
.new-case-dialog .dialog-head {
  flex:0 0 auto;
  min-height:44px;
}
.leaderboard-dialog .dialog-head .dialog-x,
.new-case-dialog .dialog-head .dialog-x {
  min-width:44px;
  min-height:44px;
}
.leaderboard-dialog .leaderboard-section,
.new-case-dialog .tresor-new-panels {
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
}
