:root { --ink: #373b36; --lcd: #a7b58a; --pixel: #2e412c; --red: #b44637; --shell: #e9e5d8; --fit-width: 390px; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: #e9ece4; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: .35; background-image: radial-gradient(#b5bcae .7px, transparent .7px); background-size: 7px 7px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; border: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button:focus { outline: 3px solid #4f6b91; outline-offset: 4px; }
button:focus:not(:focus-visible) { outline: none; }
button:focus-visible { outline: 3px solid #4f6b91; outline-offset: 4px; }
button:disabled { cursor: default; opacity: .6; }
[hidden] { display: none !important; }
.studio { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 38px 28px 48px; }
.console { position: relative; width: 390px; width: var(--fit-width, 390px); max-width: 100%; flex: 0 0 auto; padding: 23px 22px 19px; border: 1px solid #c8c4b5; border-radius: 28px 28px 65px 28px; background: linear-gradient(115deg, #f7f3e7 0%, #ece8dc 35%, #ddd9cd 100%); box-shadow: inset 2px 3px 2px #fffdf4, inset -3px -4px 3px #c6c1b4, 1px 7px 0 #bcb7aa, 2px 9px 0 #d1cdbf, 9px 24px 35px rgba(58, 69, 52, 0.1686), 28px 42px 64px rgba(57, 69, 46, 0.1333); }
.console::before { content: ""; position: absolute; top: 5px; right: 5px; bottom: 5px; left: 5px; border-radius: 24px 24px 60px 24px; border: 1px solid rgba(255, 255, 255, 0.2706); pointer-events: none; }
.shell-seam { position: absolute; bottom: 72px; left: 1px; right: 1px; height: 1px; background: rgba(199, 195, 182, 0.2667); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3765); pointer-events: none; }
.console-header { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 16px; }
.brand { display: flex; align-items: center; }
.brand-mark { font-size: 30px; color: var(--red); margin-right: 7px; line-height: 1; }
.brand h1 { font-size: 19px; font-weight: 900; letter-spacing: 2px; margin: 0 0 1px; line-height: 1.2; }
.brand div > span { font: 8px/1.3 "Courier New", monospace; font-weight: 700; letter-spacing: 2.2px; }
.model { align-self: flex-start; display: flex; align-items: center; padding-top: 7px; font: 8px/1 "Courier New", monospace; letter-spacing: 1px; }
.power-dot { width: 5px; height: 5px; border-radius: 50%; background: #b74a3a; box-shadow: 0 0 0 2px #d3cdbd, inset 0 1px 1px rgba(255, 255, 255, 0.6); margin-right: 6px; }
.power-dot.playing { background: #ed6d45; box-shadow: 0 0 0 2px #cfc7b7, 0 0 6px #c26042; }
.bezel { background: linear-gradient(135deg, #4d514b, #353a35); border-radius: 13px 13px 30px 13px; padding: 12px 12px 10px; box-shadow: 0 2px 1px rgba(255, 255, 255, 0.7529), 0 -1px 2px #a4a295, inset 1px 1px 2px #2b302c; }
.bezel-top { color: #c7c9ba; font: 7px/1 "Courier New", monospace; letter-spacing: 1px; display: flex; justify-content: space-between; padding: 0 4px 9px; }
.bezel-top > span:last-child { color: #b87f63; font-size: 6px; }
.lcd { position: relative; background: var(--lcd); padding: 9px 10px 6px; color: var(--pixel); box-shadow: inset 3px 4px 7px rgba(37, 55, 35, 0.302), inset -1px -1px 1px rgba(216, 223, 187, 0.5647), 0 0 0 2px #232d27; border-radius: 3px; }
.lcd::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: linear-gradient(120deg, rgba(255, 255, 255, 0.0471), transparent 40%, rgba(54, 72, 45, 0.051)); }
.lcd-top { height: 22px; display: flex; justify-content: space-between; font: bold 8px/1 "Courier New", monospace; letter-spacing: .6px; padding: 3px 1px 0; }
.lcd-content { display: flex; align-items: stretch; }
.board-area { position: relative; width: 61%; flex: 0 0 61%; border: 2px solid #435339; padding: 2px; background: #9bab7e; box-shadow: 1px 1px 0 #d0d9b2; }
#board { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.dashboard { width: 39%; padding-left: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.arcade-lcd .lcd-content { flex-direction: column; }
.arcade-lcd .lcd-content .board-area { flex: 0 0 auto; width: 100%; align-self: center; }
.arcade-lcd .lcd-content .dashboard { width: 100%; min-width: 0; padding: 6px 0 0; flex-direction: row; align-items: flex-start; justify-content: space-between; }
.arcade-lcd .readout { margin: 0 4px; }
.arcade-lcd .readout output, .readout-value { font: bold 14px/1.2 "Courier New", monospace; letter-spacing: 0; }
.readout-value { display: block; margin-top: 3px; }
.game-readouts { display: flex; flex: 1 1 auto; justify-content: space-between; }
.readout > span, .next-block > span { display: block; font: bold 7px/1.3 "Courier New", monospace; letter-spacing: .2px; white-space: nowrap; }
.readout output { display: block; margin-top: 3px; font: bold 21px/1.05 "Courier New", monospace; letter-spacing: -1px; text-shadow: 1px 1px 0 rgba(211, 221, 179, 0.2314); }
.small-readout output { font-size: 20px; }
#next { display: block; width: 78%; max-width: 96px; height: auto; margin: 4px 0 2px; }
.lcd-decoration { padding-top: 4px; }
.lcd-decoration span { display: block; opacity: .6; letter-spacing: 3px; font-size: 10px; margin-bottom: 5px; }
.lcd-decoration b { font: bold 12px/.95 "Courier New", monospace; letter-spacing: 1px; opacity: .65; }
.lcd-footer { display: flex; justify-content: space-between; padding-top: 8px; font: 7px/1.4 "Courier New", "PingFang SC", monospace; min-height: 19px; }
.lcd-footer > span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 81%; }
.bezel-bottom { display: flex; align-items: center; justify-content: center; margin-top: 10px; color: #c8cbbb; font: 6px/1 "Courier New", monospace; letter-spacing: 1px; }
.bezel-bottom i { height: 1px; width: 17px; background: #8e9586; margin: 0 6px; }
.screen-message { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(167, 181, 138, 0.9333); text-align: center; padding: 8px; z-index: 2; }
.message-kicker { font: bold 8px/1.4 "Courier New", monospace; letter-spacing: 1px; }
.screen-message h2 { font-size: 31px; font-weight: 900; line-height: 1.2; letter-spacing: 4px; margin: 10px 0; text-shadow: 2px 2px 0 rgba(211, 221, 179, 0.3961); white-space: pre-line; }
.screen-message p { font-size: 12px; line-height: 1.7; margin: 0 0 13px; white-space: pre-line; }
.lcd-button { min-height: 44px; width: 100%; max-width: 145px; padding: 9px 7px; color: #b8c69b; background: var(--pixel); border: 2px solid var(--pixel); box-shadow: inset 0 0 0 2px var(--lcd); font-size: 12px; font-weight: 700; }
.lcd-button:active { color: var(--pixel); background: transparent; }
.lcd-button span { margin-left: 6px; }
.screen-cancel { min-height: 44px; background: transparent; font-size: 12px; text-decoration: underline; padding: 4px 8px; }
.lcd.line-flash { animation: lcd-flash 230ms ease-out; }
@keyframes lcd-flash { 35% { box-shadow: inset 3px 4px 7px rgba(37, 55, 35, 0.302), inset 0 0 30px rgba(232, 242, 200, 0.6667), 0 0 0 2px #232d27; } }
/* Function keys share one face, label size and press depth. */
.utility-row { display: flex; margin: 13px 0 13px; padding: 0 1px; }
.utility { position: relative; flex: 1 1 0; min-width: 44px; min-height: 50px; padding: 5px 1px; border: 1px solid #b4b4a5; border-radius: 8px; background: linear-gradient(#e5e4d8, #d4d4c5); color: #414b3c; box-shadow: 0 3px 0 #a2a593, 0 4px 2px rgba(78, 86, 65, .18), inset 0 1px 0 #f8f7eb; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; line-height: 1.25; font-weight: 700; letter-spacing: 0; }
.utility + .utility { margin-left: 6px; }
.utility-cap { display: block; font: bold 16px/18px "Courier New", monospace; margin-bottom: 3px; }
#pause { color: #f6f2dc; border-color: #555e4e; background: linear-gradient(#6f7b62, #515d47); box-shadow: 0 3px 0 #37432e, 0 4px 2px rgba(78, 86, 65, .2), inset 0 1px 0 #939e84; }
.utility[aria-pressed="false"] { color: #656b5f; background: linear-gradient(#deded3, #cbcebf); }
.utility[aria-pressed="true"]::after { content: ""; position: absolute; top: 5px; right: 5px; width: 4px; height: 4px; background: #4e7557; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.utility:active { transform: translateY(2px); box-shadow: 0 1px 0 #929882, inset 0 1px 3px rgba(66, 77, 53, .2); }
#pause:active { box-shadow: 0 1px 0 #37432e, inset 0 1px 3px #3f4e34; }
.controls { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 172px; padding: 2px 0 0; -webkit-user-select: none; user-select: none; touch-action: none; }
.direction-cluster { flex: 0 0 144px; width: 144px; text-align: center; }
.dpad-well { position: relative; width: 144px; height: 144px; border-radius: 50%; background: linear-gradient(130deg, #cecabc, #efebde); box-shadow: inset 1px 2px 3px rgba(169, 167, 152, 0.3765), 0 1px 1px rgba(255, 255, 255, 0.6); }
.dpad-body { position: absolute; top: 7px; right: 7px; bottom: 7px; left: 7px; }
.dpad-body::before, .dpad-body::after { content: ""; position: absolute; background: #393e39; border-radius: 4px; box-shadow: 0 5px 0 #242b26, 0 7px 4px rgba(58, 64, 44, 0.3137); }
.dpad-body::before { width: 44px; top: 0; bottom: 0; left: 43px; }
.dpad-body::after { height: 44px; left: 0; right: 0; top: 43px; }
.dpad { position: absolute; z-index: 1; width: 44px; height: 44px; padding: 0; background: linear-gradient(130deg, #50554f, #383e38); color: #868c7d; text-shadow: 0 1px 0 #1f281f; box-shadow: inset 1px 1px 1px rgba(119, 126, 112, 0.3686); font-size: 16px; }
.dpad-up { top: 7px; left: 50px; border-radius: 4px 4px 0 0; }
.dpad-left { left: 7px; top: 50px; border-radius: 4px 0 0 4px; }
.dpad-right { right: 7px; top: 50px; border-radius: 0 4px 4px 0; }
.dpad-down { bottom: 7px; left: 50px; border-radius: 0 0 4px 4px; }
.dpad-center { position: absolute; width: 44px; height: 44px; top: 50px; left: 50px; background: #414740; z-index: 2; pointer-events: none; }
.dpad-center::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; top: 11px; left: 11px; background: linear-gradient(135deg, #353c34, #555b50); box-shadow: inset 1px 1px 3px rgba(37, 44, 37, 0.6), 1px 1px 0 #5c6255; }
.dpad.is-pressed, .dpad:active { transform: translateY(3px); color: #a6ae99; background: #363d35; box-shadow: inset 1px 2px 3px #222b23; }
.control-caption { display: block; font: bold 12px/1.3 "Courier New", "PingFang SC", monospace; letter-spacing: 0; margin-top: 9px; color: #51594a; }
.control-caption > span { font-size: 9px; letter-spacing: .5px; }
.action-cluster { flex: 0 1 147px; width: 147px; min-width: 122px; height: 144px; position: relative; margin-left: 6px; }
.action-position { position: absolute; text-align: center; }
.rotate-position { right: 0; top: 4px; }
.drop-position { left: 0; bottom: 0; }
.action-button { width: 64px; height: 64px; min-width: 52px; min-height: 52px; border-radius: 50%; font-size: 30px; line-height: 1; color: #f2ccad; background: linear-gradient(130deg, #c45d48, #a43a2e); box-shadow: 0 5px 0 #742c25, 0 7px 3px rgba(106, 62, 53, 0.3333), 0 0 0 6px #d1cbbd, 0 1px 0 7px rgba(255, 255, 255, 0.5333), inset 1px 2px 2px rgba(238, 156, 114, 0.5333), inset -2px -2px 2px rgba(126, 44, 34, 0.3765); transition: transform 65ms ease, box-shadow 65ms ease; }
.drop-button { background: linear-gradient(130deg, #698878, #426857); color: #d2ddbc; box-shadow: 0 5px 0 #304e3d, 0 7px 3px rgba(54, 80, 64, 0.3333), 0 0 0 6px #d1cbbd, 0 1px 0 7px rgba(255, 255, 255, 0.5333), inset 1px 2px 2px rgba(169, 191, 149, 0.502), inset -2px -2px 2px rgba(41, 69, 49, 0.3765); }
.action-button.is-pressed, .action-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #622d26, 0 2px 2px rgba(106, 62, 53, 0.3333), 0 0 0 6px #d1cbbd, inset 1px 2px 4px rgba(68, 37, 31, 0.4667); }
.console-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 8px 0 0; border-top: 1px solid #c9c7b8; }
.author-info { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; min-height: 44px; padding: 3px 4px 3px 1px; background: transparent; text-align: left; border-radius: 6px; }
.author-avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; margin-right: 7px; border: 1px solid #b3b69f; box-shadow: 0 1px 0 #fffbee; }
.author-copy { min-width: 0; display: block; }
.author-copy strong { display: block; font-size: 12px; line-height: 1.4; }
.author-copy > span { display: block; font-size: 10px; line-height: 1.5; color: #626d58; }
.author-chevron { margin-left: 6px; font: 22px/1 sans-serif; color: #7a826c; }
.author-info:active { background: rgba(129,140,108,.12); }
.plaque-button { min-width: 44px; min-height: 44px; padding: 9px 12px; border: 1px solid #a8ad96; border-radius: 8px; color: #44533d; background: linear-gradient(#f4f1e4, #dfdfcd); box-shadow: 0 2px 0 #afb59e, inset 0 1px 0 #fffdf2; font-size: 13px; line-height: 1.35; font-weight: 700; }
.plaque-primary { color: #f8f3df; background: linear-gradient(#738264, #56674a); border-color: #4c5b40; box-shadow: 0 2px 0 #37472d, inset 0 1px 0 #98a68b; }
.plaque-button:active { transform: translateY(1px); box-shadow: 0 1px 0 #929b82, inset 0 1px 3px rgba(52,69,37,.2); }
.follow-button { flex: 0 0 auto; margin-left: 6px; padding-left: 10px; padding-right: 10px; font-size: 12px; }
.result-actions { display: flex; margin-top: 11px; padding-bottom: 2px; }
.result-actions > button { flex: 1 1 0; }
.result-actions > button + button { margin-left: 8px; }
/* Overlays sit outside the console so background focus can be disabled safely. */
.app-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(35,45,31,.55); padding: 16px; padding-top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); padding-right: calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px))); padding-bottom: calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); padding-left: calc(16px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); }
.panel-card { width: 360px; max-width: 100%; max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px; border: 1px solid #c4c3ac; border-radius: 15px 15px 27px 15px; color: #35452d; background: #f3f0e2; box-shadow: inset 1px 2px 0 #fffdf3, 0 5px 0 #b9bba5, 0 15px 40px rgba(26,37,21,.32); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-heading h2 { min-width: 0; margin: 0 5px 0 0; font-size: 18px; line-height: 1.4; font-weight: 800; }
.panel-close { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 0; font: 27px/1 sans-serif; border: 1px solid #d3d1bb; border-radius: 50%; color: #58654b; background: #e7e6d5; box-shadow: inset 0 1px 0 #fffdf2; }
.panel-close:active { background: #d7d9c2; }
.panel-card p { margin: 12px 0 0; font-size: 13px; line-height: 1.8; overflow-wrap: break-word; }
.panel-kicker { font: bold 9px/1.5 "Courier New", monospace; letter-spacing: 1.5px; color: #768167; }
.creator-identity { display: flex; align-items: center; padding: 13px 0; border-top: 1px solid #cccfb9; border-bottom: 1px solid #cccfb9; }
.creator-identity > div { min-width: 0; }
.creator-avatar { flex: 0 0 56px; width: 56px; height: 56px; margin-right: 12px; object-fit: cover; border: 2px solid #d8dbc2; border-radius: 50%; }
.creator-identity h3 { margin: 3px 0 0; font-size: 19px; line-height: 1.35; overflow-wrap: break-word; }
.panel-main-action { width: 100%; margin-top: 18px; }
.panel-card .panel-note { color: #67745b; font-size: 12px; line-height: 1.6; }
.score-card-preview { display: block; width: 100%; height: auto; border: 1px solid #b7bca2; border-radius: 5px; margin-bottom: 15px; }
.share-actions { display: flex; }
.share-actions > button { flex: 1 1 0; }
.share-actions > button + button { margin-left: 8px; }
.instructions .keyboard-help { border-top: 1px solid #cdc8b8; padding-top: 12px; color: #65715a; }
#storage-status { color: #65715a; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 500px) {
  .studio { padding: 12px 12px 20px; padding-top: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); padding-bottom: calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); min-height: 100vh; min-height: var(--app-height, 100vh); }
  .studio { padding-left: calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px))); padding-right: calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px))); }
  .console { padding: 19px 18px 15px; border-radius: 25px 25px 53px 25px; }
  .console-header { padding-bottom: 12px; }
  .controls { padding-right: 0; padding-left: 0; }
  .action-button { width: 60px; height: 60px; }
  .lcd-top { height: 20px; }
  .dashboard { padding-left: 9px; }
  .readout output { font-size: 19px; }
}
@media (max-width: 350px) {
  .studio { padding-left: 7px; padding-right: 7px; }
  .console { padding-left: 14px; padding-right: 14px; }
  .brand h1 { font-size: 17px; }
  .model { font-size: 7px; }
  .bezel { padding-left: 9px; padding-right: 9px; }
  .lcd { padding-left: 8px; padding-right: 8px; }
  .readout output { font-size: 16px; }
  .readout > span, .next-block > span { font-size: 6px; }
  .action-cluster { width: 122px; }
  .action-button { width: 56px; height: 56px; }
  .screen-message h2 { font-size: 26px; }
  .lcd-decoration b { font-size: 10px; }
}
@media (max-height: 720px) and (min-width: 351px) and (max-width: 900px) { .console { width: 335px; } .studio { padding-top: 9px; padding-bottom: 16px; } .console-header { padding-bottom: 10px; } .console { padding-top: 15px; } .action-cluster { width: 124px; } .action-button { width: 60px; height: 60px; } }
@media (max-height: 760px) and (max-width: 500px) {
  .studio { padding-top: calc(7px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))); padding-bottom: calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }
  .console { padding-top: 13px; padding-bottom: 10px; }
  .console-header { padding-bottom: 9px; }
  .board-area { width: 54%; flex-basis: 54%; }
  .dashboard { width: 46%; padding-left: 13px; }
  .lcd-decoration { display: none; }
  .lcd-top { height: 17px; }
  .lcd-footer { padding-top: 5px; min-height: 16px; }
  .bezel-top { padding-bottom: 7px; }
  .bezel-bottom { margin-top: 7px; }
  .utility-row { margin-top: 9px; margin-bottom: 10px; }
  .utility { min-height: 48px; }
 
}
@media (max-height: 650px) and (max-width: 500px) { .console { border-radius: 23px 23px 39px 23px; } .controls { padding-bottom: 5px; } }
.compact-layout .console { padding-top: 13px; padding-bottom: 10px; }
.compact-layout .console-header { padding-bottom: 9px; }
.compact-layout .screen-message h2 { font-size: 26px; line-height: 1.1; margin: 5px 0; letter-spacing: 2px; }
.compact-layout .screen-message p { line-height: 1.4; margin-bottom: 8px; }
.compact-layout .board-area { width: 54%; flex-basis: 54%; }
.compact-layout .dashboard { width: 46%; padding-left: 13px; }
.compact-layout .lcd-decoration { display: none; }
.compact-layout .lcd-top { height: 17px; }
.compact-layout .lcd-footer { padding-top: 5px; min-height: 16px; }
.compact-layout .bezel-top { padding-bottom: 7px; }
.compact-layout .bezel-bottom { margin-top: 7px; }
.compact-layout .bezel-top, .compact-layout .bezel-bottom { display: none; }
.compact-layout .utility-row { margin-top: 9px; margin-bottom: 10px; }
.compact-layout .utility { min-height: 48px; }
.compact-layout .console-footer { margin-top: 8px; padding-top: 5px; }
.short-layout .console-footer { margin-top: 5px; padding-top: 3px; }
.short-layout .board-area { width: 49%; flex-basis: 49%; }
.short-layout .dashboard { width: 51%; }
.short-layout .console { border-radius: 23px 23px 39px 23px; }
.short-layout .studio { align-items: flex-start; }
@media (orientation: landscape) and (max-height: 500px) { .studio { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
