:root{color-scheme:light;--paper:#f2ebdd;--surface:#faf6ec;--ink:#3b342b;--muted:#766956;--line:#d8cbb6;--accent:#615039;--green:#35553d;--red:#9b3d2a;font-family:"DM Sans",system-ui,sans-serif;color:var(--ink);background:var(--paper);font-size:16px}
*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a,input,textarea,summary{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #998057;outline-offset:4px}a{color:inherit}button{border:0}button,input{min-height:44px}button{transition:background .15s}button.primary{background:var(--accent);color:#fffaf0;border-radius:7px;padding:11px 23px;font-weight:600}button.primary:hover:enabled{background:#4c3e2b}button.secondary{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:9px 16px}button.secondary:hover:enabled{background:#e9dfcc}.text-button{background:none;color:var(--ink);padding:8px 0;text-decoration:none}.text-button:hover{text-decoration:underline}.muted,.status,footer{color:var(--muted);font-size:.875rem}.site-header{max-width:1184px;margin:auto;padding:25px 32px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:20px}.wordmark{font-family:Georgia,serif;font-size:1.7rem;letter-spacing:-1px;text-decoration:none}.wordmark span{font-family:"DM Sans",system-ui,sans-serif;color:var(--muted);font-size:.875rem;letter-spacing:0;margin-left:9px}.home{max-width:720px;margin:auto;padding:0 28px}.daily-intro{text-align:center;padding:65px 0 36px}.eyebrow{font-size:.8125rem;font-weight:500;letter-spacing:.12em;color:var(--muted);text-transform:uppercase;margin:0 0 15px}h1,h2,p{margin-top:0}h1{font-family:Georgia,serif;font-weight:400;letter-spacing:-1.3px;font-size:3.25rem;line-height:1.1;margin-bottom:18px}.daily-intro>p:not(.eyebrow):not(.status){color:var(--muted);line-height:1.6}.play{margin-top:13px;min-width:240px;min-height:54px}.play span{margin-left:24px;font-size:1.25rem}.status{min-height:20px;line-height:1.5;margin:13px 0 0}.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:15px;margin:0 0 18px}h2{font-size:1.125rem;font-weight:500;margin:0}.leaderboard{padding-top:18px}table{width:100%;border-collapse:collapse;text-align:left}th{font-size:.8125rem;font-weight:500;color:var(--muted);padding:12px 15px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}td{padding:17px 15px;border-bottom:1px solid var(--line)}th:first-child,td:first-child{width:70px;color:var(--muted)}.time-cell{text-align:right;font-variant-numeric:tabular-nums}.time-cell:not(th){font-family:"JetBrains Mono",monospace;font-size:.9375rem}tr.me{background:#e9dfcb}.you{font-size:.8125rem;margin-left:8px;color:var(--muted)}td.empty{text-align:center;padding:34px 12px;color:var(--muted);line-height:1.7;font-size:.9375rem}footer{padding:35px 0 28px;text-align:center;font-size:.8125rem}footer a{margin-left:12px;text-underline-offset:3px}.game{max-width:1184px;margin:auto;padding:0 32px 48px}.game-bar{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:23px 0}.clock{display:flex;align-items:center;gap:16px}.clock output{font-family:"JetBrains Mono",monospace;font-size:1.5rem;font-variant-numeric:tabular-nums;min-width:121px;text-align:right}.workspace{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:48px;padding-top:23px}.problem h1{font-size:2.3rem;line-height:1.15;letter-spacing:-.9px}.problem p{line-height:1.65;white-space:pre-wrap;margin-bottom:22px}.problem .eyebrow{margin-bottom:14px;font-size:.8125rem}.problem h2{font-size:.9375rem;margin:24px 0 7px}.example{background:var(--surface);border:1px solid var(--line);padding:17px 20px;border-radius:7px}.code-label{font-size:.75rem;color:var(--muted);letter-spacing:.06em}pre,code,textarea{font-family:"JetBrains Mono",Consolas,monospace}pre{font-size:.875rem;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 18px}.example pre:last-child{margin-bottom:0}details{margin-top:22px;font-size:.875rem;color:var(--muted)}summary{cursor:pointer;min-height:35px}details p{margin-top:8px}.solution{min-width:0}.editor-heading{display:flex;justify-content:space-between;padding:0 0 13px}.editor-heading h2{font-size:1rem}#code-editor{display:block;width:100%;min-height:390px;resize:vertical;background:var(--surface);color:var(--ink);padding:20px;border:1px solid var(--line);border-radius:7px;font-size:.875rem;line-height:1.8;tab-size:4;white-space:pre;overflow:auto}#code-editor:focus{outline-offset:1px}.editor-actions{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 0}.editor-actions>div{display:flex;gap:8px}.editor-actions .muted{font-size:.8125rem}.result{padding:17px 0;border-top:1px solid var(--line);font-size:.9375rem;line-height:1.6}.result p{margin:0}.result pre{background:var(--surface);padding:14px;border-radius:5px;margin:12px 0 0;max-height:300px;overflow:auto}.good{color:var(--green)}.bad,.error{color:var(--red)}.solved-banner{background:#e3e7d5;border:1px solid #c6cdb6;border-radius:7px;padding:14px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;color:var(--green)}dialog{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:28px;width:min(420px,calc(100% - 32px));box-shadow:0 18px 70px #3b342b22}dialog::backdrop{background:#3b342b55}.dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-top:-10px}.dialog-heading h2{font-family:Georgia,serif;font-size:1.7rem}.dialog-heading button{font-size:1.5rem;padding-left:20px}dialog p{line-height:1.6}label{display:block;font-size:.875rem;margin:16px 0 7px}input{width:100%;border:1px solid var(--line);background:var(--paper);padding:10px 12px;border-radius:5px;color:var(--ink)}dialog .primary{width:100%;margin-top:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}[hidden]{display:none!important}
@media(max-width:800px){.workspace{grid-template-columns:1fr;gap:35px}.game{padding:0 22px 40px}.site-header{padding:20px 22px}.daily-intro{padding-top:48px}.problem h1{font-size:2.1rem}#code-editor{min-height:360px}.clock{gap:9px}.clock output{font-size:1.25rem}.game-bar{padding:17px 0}.solved-banner{align-items:flex-start;flex-direction:column;gap:3px}}
@media(max-width:420px){.home{padding:0 20px}h1{font-size:2.65rem}.section-heading{align-items:flex-start;flex-direction:column;gap:5px}td,th{padding-left:10px;padding-right:10px}.editor-actions{align-items:flex-start;flex-direction:column}.game-bar .muted{font-size:.8125rem}.wordmark{font-size:1.5rem}.site-header #player-label{max-width:130px;overflow-wrap:anywhere}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* The coding surface uses a VS Code-style dark palette inside the beige game. */
.ide-shell{color-scheme:dark;background:#1e1e1e;color:#d4d4d4;border:1px solid #373737;border-radius:9px;box-shadow:0 8px 24px #3b342b12;overflow:hidden}
.ide-tabs{display:flex;align-items:center;justify-content:space-between;background:#181818;border-bottom:1px solid #303030;min-height:45px;padding-right:16px}
.ide-tab{display:flex;gap:9px;align-items:center;background:#1e1e1e;border-top:2px solid #d8bd88;border-right:1px solid #303030;padding:12px 18px;font-size:.875rem;color:#eee}
.python-icon{font-size:.75rem;font-weight:700;color:#e2c77c;letter-spacing:-.04em}.ide-language{color:#a4a4a4;font-size:.8125rem}
.editor-surface{height:440px;min-width:0;position:relative}.editor-surface #python-editor{height:100%;width:100%}
.editor-surface #code-editor{height:100%;min-height:0;resize:none;border:0;border-radius:0;padding:16px 20px;background:#1e1e1e;color:#d4d4d4;caret-color:#aeafad;font-family:JetBrains Mono,Menlo,Consolas,monospace;line-height:24px;font-size:14px;outline-offset:-2px}
.ide-status{background:#252526;border-top:1px solid #303030;display:flex;justify-content:space-between;gap:12px;padding:7px 15px;font-size:.75rem;color:#b8b8b8;min-height:30px}
.ide-shell .editor-actions{padding:13px 15px;margin:0;border-top:1px solid #303030;background:#1e1e1e;gap:10px}.ide-shell .muted{color:#a9a9a9}.ide-shell .editor-actions .muted{font-size:.75rem}
.ide-shell button.primary{background:#d2bb90;color:#25211a;padding:9px 18px}.ide-shell button.primary:hover:enabled{background:#e4cea7}
.ide-shell button.secondary{background:#303030;color:#e2e2e2;border-color:#474747;padding:9px 13px}.ide-shell button.secondary:hover:enabled{background:#3c3c3c}
.ide-shell .text-button{color:#d8bd88}.ide-shell .result{background:#181818;padding:15px;border-color:#303030;font-size:.875rem;min-height:106px}.output-label{display:block;color:#b3b3b3;font-size:.75rem;letter-spacing:.08em;margin-bottom:10px}
.ide-shell .result pre{background:#202020;color:#d4d4d4;padding:12px;border:1px solid #303030;font-size:.8125rem}.ide-shell .result .good{color:#a6d39b}.ide-shell .result .bad{color:#f1a39c}
.monaco-editor input,.monaco-editor button{min-height:0}.monaco-editor .inputarea{min-height:0}
@media(max-width:800px){.editor-surface{height:420px}}
@media(max-width:420px){.editor-heading{gap:12px;align-items:baseline}.editor-heading>.muted{font-size:.75rem;text-align:right}.ide-shell .editor-actions>div{width:100%}.ide-shell .editor-actions>div>button{flex:1}.ide-shell .editor-actions{padding:12px}.ide-status{padding:7px 12px}}

#sample-input{white-space:pre-wrap;overflow-wrap:anywhere}

.site-header{flex-wrap:wrap}.wordmark{line-height:1.2}.wordmark span{white-space:nowrap}

/* Today, Elo, and medal standings. */
.header-left{display:flex;align-items:center;flex-wrap:wrap;gap:8px 22px}.header-left .wordmark{white-space:nowrap}#login-button{font-size:.875rem}#switch-player-button{display:block;margin:8px auto 0}
.player-identity{display:flex;flex-direction:column;align-items:flex-end;gap:4px;max-width:55%}#identity-note{font-size:.7rem;text-align:right}
.player-name-row{display:flex;align-items:center;justify-content:flex-end;gap:6px;max-width:100%}#player-label{cursor:pointer;overflow-wrap:anywhere}#edit-name-button{padding:4px 7px;min-width:32px;min-height:32px;font-size:1rem}#player-label:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
.board-controls{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}.board-tabs{display:flex;background:#e8decb;padding:4px;border-radius:8px;gap:4px}.board-tab{background:transparent;color:var(--muted);padding:8px 14px;border-radius:5px;font-size:.875rem}.board-tab[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #3b342b18;font-weight:600}
.board-table{overflow-x:auto}.rating-change{display:block;font-family:"DM Sans",system-ui,sans-serif;font-size:.75rem;margin-top:4px}.all-time-board th,.all-time-board td{padding-left:10px;padding-right:10px}
@media(max-width:480px){.board-controls{gap:12px}.all-time-board .time-cell:not(th){font-size:.8125rem}.all-time-board .you{display:block;margin-left:0}.player-identity{max-width:45%}.site-header{gap:10px}#identity-note{font-size:.65rem}}

.practice-link{display:block;margin:10px auto 0;font-size:.875rem;color:var(--muted)}
.medals-board th,.medals-board td{padding-left:10px;padding-right:10px}.medals-board th:first-child,.medals-board td:first-child{width:48px}.medals-board td:nth-child(2){overflow-wrap:anywhere}.medals-board .medal-points{font-weight:700}#medal-rules p{line-height:1.65;margin:6px 0 12px}
@media(max-width:480px){.medals-board th,.medals-board td{padding-left:5px;padding-right:5px}.medals-board th:first-child,.medals-board td:first-child{width:32px}.medals-board th{font-size:.65rem;letter-spacing:0}.medals-board td{font-size:.8125rem}.medals-board .you{display:block;margin-left:0}}
#python-editor{height:100%}.cm-editor .cm-scroller{min-height:0}.cm-editor button,.cm-editor input{min-height:0}.cm-editor .cm-search input{width:auto}

/* The reference tab is unlocked only after a solve or give-up. */
.code-tabs{display:flex;align-self:stretch;min-width:0}.ide-tabs{padding-left:0;gap:10px}.ide-tabs button.ide-tab{border:0;border-radius:0;border-top:2px solid transparent;background:transparent;color:#aaa;min-height:44px;padding:10px 16px;font-size:.8125rem;white-space:nowrap}.ide-tabs button.ide-tab[aria-selected="true"]{background:#1e1e1e;border-top-color:#d2bb90;color:#eee}.ide-tabs button.ide-tab:hover{background:#292929}.ide-tabs .ide-language{padding-right:12px;white-space:nowrap}
.give-up-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 15px 12px;color:#a9a9a9;font-size:.75rem}.give-up-actions button{font-size:.8125rem}.reference-note{margin:0;padding:15px;color:#b8b8b8;font-size:.8125rem;border-bottom:1px solid #303030}.reference-editor{min-height:440px}#reference-code{margin:0;min-height:440px;padding:16px;background:#1e1e1e;color:#ddd;white-space:pre-wrap;overflow-wrap:anywhere}.solved-banner.dnf{background:#eee0cf;border-color:#d8bfa4;color:#71462a}
@media(max-width:420px){.ide-tabs button.ide-tab{padding:10px}.ide-tabs .ide-language{font-size:.7rem}.give-up-actions{align-items:flex-start}.reference-editor .cm-scroller{font-size:12px}}
.game-bar{flex-wrap:wrap}.game-bar .clock{margin-left:auto}
.custom-test-panel{padding:12px 15px;border-top:1px solid #303030;background:#202020;font-size:.8125rem;color:#d4d4d4}
.custom-test-panel p{line-height:1.5;margin:12px 0}
.custom-test-panel label{display:block;margin:12px 0 6px;font-family:Menlo,Consolas,monospace;font-size:.75rem}
.custom-test-panel textarea{display:block;width:100%;min-height:64px;max-height:300px;resize:vertical;padding:10px;border:1px solid #474747;border-radius:4px;background:#181818;color:#ddd;font:13px/1.6 Menlo,Consolas,monospace}
.custom-test-panel textarea:focus{outline:2px solid #d2bb90;outline-offset:1px}.custom-test-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px}.custom-test-footer button{flex-shrink:0;font-size:.8125rem}#custom-test-error{color:#f1a39c}
@media(max-width:600px){#next-practice-button{order:3;width:100%}}

/* Keep local inputs beside the editor, with run controls outside scrolling code. */
.problem-column{display:flex;flex-direction:column;gap:16px;min-width:0;min-height:0}
.custom-test-panel{margin:0;padding:10px 14px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink)}
.custom-test-title{margin:0;min-height:28px;font-size:inherit;line-height:28px;color:var(--accent);font-weight:500}
.custom-test-panel .custom-test-body{display:flex;flex-direction:column;min-height:0}
.custom-test-panel p{margin:6px 0 10px;font-size:.75rem;line-height:1.4}
#custom-test-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-height:0}
.custom-argument{display:flex;flex-direction:column;min-width:0}.custom-argument:only-child{grid-column:1/-1}
.custom-test-panel label{margin:0 0 5px;font-size:.6875rem;line-height:1.4;overflow-wrap:anywhere}
.custom-test-panel textarea{min-height:58px;height:58px;max-height:180px;padding:8px;border-color:var(--line);background:var(--paper);color:var(--ink);font-size:12px;line-height:1.5}
.custom-test-panel .compact-argument textarea{min-height:34px;height:34px}
.custom-test-footer{margin-top:8px;flex-shrink:0}.custom-test-footer button{min-height:32px;padding:4px 0;color:var(--accent)}#custom-test-error{color:var(--red);font-size:.75rem;line-height:1.4}
.ide-shell .editor-actions{flex-wrap:nowrap;gap:8px}.editor-actions .give-up-actions{padding:0;flex-shrink:0}.editor-actions .run-actions{margin-left:auto}
.ide-status #save-status{font-size:.6875rem;text-align:right}
.io-column{min-width:0;min-height:0}.io-column .editor-heading h2{font-size:1rem}
.io-shell{background:var(--surface);border:1px solid var(--line);border-radius:7px;overflow:hidden}
.io-shell .custom-test-panel{border:0;border-bottom:1px solid var(--line);border-radius:0}
.io-shell .result{padding:12px 14px;border-top:0;min-height:160px}.io-shell .output-label{color:var(--muted)}
.io-shell .result pre{background:var(--paper);border:1px solid var(--line);padding:10px;font-size:.8125rem}

@media(min-width:901px){
  body:has(#game-view:not([hidden])){height:100dvh;display:flex;flex-direction:column;overflow:hidden}
  body:has(#game-view:not([hidden])) .site-header{max-width:1600px;width:100%;padding:10px 24px;flex-shrink:0;min-height:64px}
  body:has(#game-view:not([hidden])) main{flex:1;min-height:0;display:flex;flex-direction:column}
  .game{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;max-width:1600px;padding:0 24px 14px}
  .game-bar{flex-shrink:0;flex-wrap:nowrap;padding:8px 0;min-height:60px}
  .workspace{flex:1;min-height:0;padding:0;gap:20px;grid-template-columns:minmax(210px,.75fr) minmax(320px,1.5fr) minmax(220px,.8fr)}
  .problem-column{gap:12px;overflow:hidden}
  .problem{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px 10px 10px 0}
  .problem h1{font-size:clamp(1.6rem,2.3vw,2rem);margin-bottom:14px}.problem .eyebrow{margin-bottom:9px;font-size:.75rem}
  .problem p{font-size:.9375rem;line-height:1.6;margin-bottom:16px}.problem h2{margin-top:18px}
  .example{padding:12px 15px}.example pre{font-size:.8125rem;line-height:1.5;margin:6px 0 12px}.example p:last-child{margin-bottom:0}
  .custom-test-panel{flex-shrink:0}.custom-test-panel .custom-test-body{max-height:clamp(260px,calc(100dvh - 360px),360px)}
  #custom-test-fields{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:3px}
  #custom-test-fields.many-arguments{grid-template-columns:repeat(2,minmax(0,1fr))}
  #custom-test-fields.many-arguments:has(>:nth-child(5)){grid-template-columns:repeat(3,minmax(0,1fr))}
  .custom-test-panel p{flex-shrink:0}.custom-test-footer{min-height:32px}#custom-test-error{max-height:42px;overflow:auto}
  .solution{display:flex;flex-direction:column;min-height:0}.editor-heading{flex-shrink:0;padding-bottom:8px;align-items:baseline}.editor-heading .muted{font-size:.75rem}
  .ide-shell{display:flex;flex-direction:column;flex:1;min-height:0}.ide-tabs{flex-shrink:0;min-height:40px}.ide-tabs button.ide-tab{min-height:40px;padding-top:8px;padding-bottom:8px}
  #code-panel{display:flex;flex-direction:column;flex:1;min-height:0}.editor-surface{height:auto;min-height:0;flex:1;overflow:hidden}
  .editor-surface .cm-editor .cm-scroller{line-height:1.6}.editor-surface .cm-editor .cm-content{padding-top:10px;padding-bottom:10px}
  .ide-status{flex-shrink:0;min-height:24px;padding:4px 12px;font-size:.6875rem}
  .ide-shell .editor-actions{flex-shrink:0;min-height:56px;padding:6px 12px}
  .io-column{display:flex;flex-direction:column}.io-shell{display:flex;flex-direction:column;flex:1;min-height:0}
  .io-shell .result{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}
  .result .output-label{font-size:.6875rem;margin-bottom:5px}.result #verdict{font-size:.8125rem;flex-shrink:0;max-height:50%;overflow:auto}
  .io-shell .result pre{min-height:0;max-height:none;flex:1;margin-top:8px;font-size:.75rem;line-height:1.5;overscroll-behavior:contain}
  #retry-submit{align-self:flex-start;flex-shrink:0;min-height:28px;padding:3px 0}
  #reference-panel{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.reference-note{flex-shrink:0;padding:10px 14px;font-size:.75rem}
  .reference-editor{flex:1;min-height:0;overflow:hidden}.reference-editor .cm-editor{height:100%;min-height:0}.reference-editor .cm-scroller{overflow:auto;line-height:1.6}
  #reference-code{flex:1;min-height:0;overflow:auto}
  .solved-banner{flex-shrink:0;margin-bottom:10px;padding:6px 12px;font-size:.875rem}.solved-banner button{min-height:32px;padding:4px 0}
}
@media(min-width:801px) and (max-width:900px){.workspace{grid-template-columns:1fr;gap:24px}}
@media(max-width:420px){
  .ide-shell .editor-actions{flex-direction:row;align-items:center}.ide-shell .editor-actions>div{width:auto}.ide-shell .editor-actions .run-actions{gap:5px}
  .ide-shell .editor-actions button.secondary,.ide-shell .editor-actions button.primary{padding-left:9px;padding-right:9px;font-size:.8125rem}
  .ide-shell .give-up-actions button{font-size:.75rem}.ide-status{gap:10px}#save-status{max-width:190px}
}
