.chain-breaker {
  --cb-ink: #122326; --cb-mint: #b8ece0; --cb-gold: #e4bb78; --cb-paper: #f4ead8;
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; overflow: auto; border: 0; background: #101e22; color: var(--cb-paper);
  font: 16px/1.45 "Trebuchet MS", sans-serif; color-scheme: dark; isolation: isolate;
}
.chain-breaker[open] { display: flex; flex-direction: column; }
.chain-breaker [hidden] { display: none !important; }
.chain-breaker *, .chain-breaker *::before, .chain-breaker *::after { box-sizing: border-box; }
.chain-breaker :is(h2,h3,p,form) { margin: 0; padding: 0; border: 0; color: inherit; }
.chain-breaker button, .chain-breaker summary { font: inherit; cursor: pointer; touch-action: manipulation; }
.chain-breaker :is(button,summary,[tabindex]):focus-visible { outline: 3px solid var(--cb-mint); outline-offset: 4px; }
.cb-header { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; flex: none; gap: 12px; padding: 12px clamp(16px,4vw,58px); background: #102329; border-bottom: 1px solid #8c81634d; }
.cb-header h2 { font: 400 clamp(20px,2.9vw,33px)/1.1 "Gloock", Georgia, serif; }
.cb-header h2 em { font-style: italic; color: var(--cb-gold); }
.cb-tools { display: flex; align-items: center; gap: 8px; }
.cb-tools button { min-height: 42px; padding: .35em .9em; border: 1px solid #b6c1b45c; border-radius: 4px; background: #14292edb; color: var(--cb-paper); }
.cb-tools .cb-close { width: 44px; padding: 0; font: 30px/1 Georgia,serif; }
.cb-intro { flex: 1; min-height: 440px; position: relative; display: grid; align-items: center; }
.cb-intro-art { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#0e2025 8%,#11262af5 38%,#11262a68 62%,transparent 80%), url('/assets/pictures/acc/jacob-marley.jpg') right 25%/auto 115% no-repeat, #102329; }
.chain-breaker[data-phase="intro"] .cb-header { position: absolute; top: 0; width: 100%; padding-top: 20px; border: 0; background: transparent; justify-content: flex-end; }
.chain-breaker[data-phase="intro"] .cb-header h2 { position: absolute; left: clamp(18px,7vw,115px); top: max(9vh,60px); max-width: 74%; font-size: clamp(50px,min(8vw,10vh),108px); line-height: .95; letter-spacing: -.045em; text-shadow: 0 2px 14px #102126ad; }
.chain-breaker[data-phase="intro"] .cb-header h2 em { display: block; }
.cb-intro-copy { width: min(55%,660px); margin: min(29vh,285px) 0 16px clamp(18px,7vw,115px); }
.cb-intro-copy > p { max-width: 37ch; margin-bottom: 1.35em; font: 400 clamp(17px,2.15vw,27px)/1.35 "Newsreader", Georgia, serif; }
.cb-intro-copy h3, .cb-progress, .cb-levels small { font: 600 11px/1.4 "IBM Plex Mono", monospace; letter-spacing: .1em; }
.cb-intro-copy h3 { text-transform: uppercase; color: var(--cb-gold); margin-bottom: .8rem; }
.cb-levels { display: flex; gap: clamp(6px,1vw,14px); }
.cb-levels button { flex: 1; max-width: 150px; min-width: 0; padding: 10px 2px; display: grid; justify-items: center; gap: 4px; border: 1px solid #c09f67a6; border-radius: 5px; background: #12292ee8; color: var(--cb-paper); }
.cb-levels button:hover, .cb-levels button:focus-visible { background: #25413e; }
.cb-levels img { width: clamp(44px,5.5vw,72px); height: auto; border: 1px solid #ccb887; border-radius: 50%; }
.cb-levels strong { font: 600 clamp(15px,1.75vw,23px)/1.2 Georgia,serif; }
.cb-levels small { color: var(--cb-gold); letter-spacing: .05em; }

.cb-round { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); background: linear-gradient(100deg,#12272cf2,#102026ec),url('/assets/pictures/acc/ACC-33.jpg') center/cover; }
.cb-clue-card { padding: 11px max(18px,calc((100% - 1060px)/2)) 14px; color: var(--cb-ink); background: linear-gradient(105deg,#ecdec4,#faf1df 57%,#eee1c8); border-bottom: 3px double #9b825a; }
.cb-progress { display: flex; align-items: center; justify-content: space-between; color: #46574d; }
.cb-level-name { text-transform: uppercase; }
.cb-length { padding: 3px 10px; border: 1px solid #9b8459; border-radius: 20px; color: #483b24; background: #f5e6c8; letter-spacing: .02em; font-weight: bold; }
.cb-clue-card .cb-clue { margin-top: .22em; font: 600 clamp(20px,2.65vw,35px)/1.18 "Newsreader",Georgia,serif; text-wrap: pretty; }
.cb-clue mark { padding: 0 .18em; border-radius: .16em; background: #254744; color: #fff7dc; }
.cb-play-area { display: grid; grid-template-columns: minmax(0,1fr) clamp(160px,20vw,215px); align-items: stretch; gap: clamp(14px,2.4vw,32px); width: min(100%,1120px); min-height: 0; margin: 0 auto; padding: clamp(14px,2.4vh,28px) clamp(12px,2.7vw,36px); }
.cb-boardwell { min-height: 0; min-width: 0; display: grid; place-items: center; }
.cb-board { --cell: 30px; --rows: 12; --cols: 16; position: relative; width: 100%; aspect-ratio: var(--cols)/var(--rows); touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 3px; isolation: isolate; outline: 2px solid #cfad74; box-shadow: 0 0 0 5px #25312c,0 0 0 6px #8f7958,0 7px 32px #051618aa; background-color: #203c40;
  background-image: linear-gradient(90deg,#a5cbb218 1px,transparent 1px),linear-gradient(#a5cbb218 1px,transparent 1px),conic-gradient(#213d43 25%,#28464a 0 50%,#213d43 0 75%,#28464a 0);
  background-size: var(--cell) var(--cell),var(--cell) var(--cell),calc(var(--cell)*2) calc(var(--cell)*2); }
.cb-board:focus-visible { outline-offset: 1px !important; }
.cb-scene,.cb-words { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-scene { z-index: 1; display: block; pointer-events: none; }
.cb-words { display: grid; grid-template-columns: repeat(var(--cols),minmax(0,1fr)); grid-template-rows: repeat(var(--rows),minmax(0,1fr)); pointer-events: none; }
.cb-word { display: grid; place-items: center; margin: 1px; padding: 0 2px; border-radius: 4px; border: 1px solid #ffe6af; background: linear-gradient(#f9edc8,#e9cea0); box-shadow: inset 0 0 0 1px #917748,0 2px 3px #081e24aa; color: #27382e; font: 700 clamp(10px,calc(var(--cell)*.59),21px)/1 Georgia,serif; text-align: center; white-space: nowrap; }
.cb-steering { display: flex; flex-direction: column; align-self: center; align-items: center; gap: 16px; }
.cb-instructions { width: 100%; }
.cb-instructions p { font-size: clamp(14px,1.3vw,18px); line-height: 1.35; }
.cb-instructions .cb-feedback { font: 600 clamp(19px,2vw,25px)/1.18 "Newsreader",Georgia,serif; color: #d7f2dd; }
.cb-feedback:empty { display: none; }
.cb-feedback[data-kind="penalty"] { color: #ffd0a6; }
.cb-instructions .cb-ready { margin-top: .4em; color: #e6d7bc; }
.cb-pad { --key: clamp(42px,4.5vw,54px); display: grid; grid-template-columns: repeat(3,var(--key)); grid-template-rows: repeat(2,var(--key)); grid-template-areas: ". up ." "left down right"; gap: 4px; }
.cb-pad button { padding: 0; border-radius: 6px; border: 1px solid #b7aa84; box-shadow: 0 2px 0 #070f11; color: #fff0c8; background: #264348; font: 700 24px/1 sans-serif; touch-action: manipulation; user-select: none; }
.cb-pad button:hover,.cb-pad button:active { background: #3e625e; }
.cb-pad [data-dir="up"] { grid-area: up; }
.cb-pad [data-dir="right"] { grid-area: right; }
.cb-pad [data-dir="down"] { grid-area: down; }
.cb-pad [data-dir="left"] { grid-area: left; }
.cb-steering #cb-controls { font-size: 13px; line-height: 1.4; color: #c6d1c7; }
.cb-touch-help { display: none; }

.cb-overlay { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 75px 14px 14px; background: #0a1921c9; }
.cb-result { flex: 1; display: grid; place-items: center; padding: clamp(16px,4vw,60px); background: linear-gradient(90deg,#132d35aa,#14293266),url('/assets/pictures/acc/ACC-07.jpg') center/cover; }
.cb-paper { width: min(100%,510px); padding: clamp(20px,4vw,44px); border: 3px double #cbb07d; border-radius: 4px; background: #14292df5; box-shadow: 0 18px 60px #07161acc; }
.cb-paper h3 { color: var(--cb-paper); font: 400 clamp(30px,4.5vw,50px)/1.08 "Gloock",Georgia,serif; margin: 0 0 .35em; }
.cb-paper p { font-size: 17px; line-height: 1.5; margin: .7em 0; }
.cb-paper button { min-height: 44px; margin: .45em .32em 0 0; padding: 8px 15px; border: 1px solid #a5b3a6; border-radius: 4px; background: transparent; color: var(--cb-paper); }
.cb-paper .cb-primary { font-weight: 700; background: var(--cb-gold); color: #172b2a; border-color: var(--cb-gold); }
.cb-review { margin: 1em 0; }
.cb-review summary { color: var(--cb-mint); }
.cb-review ol { margin: .65em 0 0; padding-left: 1.45em; }
.cb-review li + li { margin-top: .35em; }
@media(max-width:640px) and (orientation:portrait) {
  .cb-header { padding: 8px 12px; }
  .cb-intro { min-height: 490px; align-items: end; }
  .cb-intro-art { background: linear-gradient(0deg,#102329 5%,#102329ee 38%,#10232912 82%),url('/assets/pictures/acc/jacob-marley.jpg') 70% top/auto 78% no-repeat,#102329; }
  .chain-breaker[data-phase="intro"] .cb-header h2 { top: 10vh; left: 18px; max-width: 75%; font-size: clamp(42px,10.5vw,65px); }
  .cb-intro-copy { width: auto; margin: 0; padding: 15px 18px max(25px,6vh); }
  .cb-levels button { max-width: none; }
  .cb-levels img { width: 44px; }
}
@media (max-height:520px) and (orientation:landscape) {
  .cb-intro { min-height: 276px; }
  .chain-breaker[data-phase="intro"] .cb-header { padding: 8px 12px; }
  .chain-breaker[data-phase="intro"] .cb-header h2 { top: 4vh; left: 5vw; max-width: 82%; font-size: clamp(28px,9vh,44px); }
  .chain-breaker[data-phase="intro"] .cb-header h2 em { display: inline; }
  .cb-intro-copy { width: min(67%,540px); margin: 58px 0 9px 5vw; }
  .cb-intro-copy > p { max-width: 46ch; margin-bottom: .6em; font-size: clamp(15px,4.2vh,19px); }
  .cb-intro-copy h3 { margin-bottom: .35rem; }
  .cb-levels button { padding: 5px 2px; gap: 2px; }
  .cb-levels img { width: 30px; }
}
@media (max-width:680px) and (orientation:portrait) {
  .cb-round { min-height: 380px; }
  .cb-play-area { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; padding: 12px 10px max(15px,env(safe-area-inset-bottom)); gap: 12px; }
  .cb-steering { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 12px; }
  .cb-instructions { grid-area: 1 / 1; }
  .cb-pad { grid-area: 1 / 2 / 3; --key: 44px; }
  .cb-steering #cb-controls { grid-area: 2 / 1; font-size: 12px; }
  .cb-clue-card { padding: 8px 12px 10px; }
  .cb-play-area { align-content: center; }
}
@media (max-height:540px) and (orientation:landscape) {
  .cb-header { padding: 3px 12px; }
  .cb-header h2 { font-size: 21px; }
  .cb-tools button { min-height: 34px; }
  .cb-clue-card { padding: 4px 12px 6px; }
  .cb-clue-card .cb-clue { font-size: 19px; }
  .cb-play-area { grid-template-columns: minmax(0,1fr) 160px; padding: 8px 12px; gap: 12px; }
  .cb-steering { gap: 5px; }
  .cb-instructions .cb-feedback { font-size: 18px; }
  .cb-pad { --key: 42px; gap: 2px; }
  .cb-steering #cb-controls { font-size: 11px; }
}
@media (pointer:coarse) {
  .cb-key-help { display: none; }
  .cb-touch-help { display: inline; }
}
@media (max-height:380px) and (orientation:landscape) {
  .cb-clue-card .cb-clue { font-size: 17px; }
  .cb-instructions .cb-feedback { font-size: 16px; }
  .cb-instructions .cb-ready { margin-top: .2em; font-size: 12px; }
  .cb-steering { gap: 3px; }
}
@media (max-height:620px) and (orientation:portrait) {
  .cb-play-area { padding: 9px 10px 10px; gap: 8px; }
  .cb-instructions .cb-feedback { font-size: 16px; }
  .cb-instructions .cb-ready { font-size: 13px; }
}
@media (max-height:580px) and (orientation:portrait) {
  .cb-intro { min-height: 440px; }
  .chain-breaker[data-phase="intro"] .cb-header h2 { top: 45px; }
  .cb-intro-copy { padding-bottom: 14px; }
}

