:root { color-scheme: light; font-family: "MS Sans Serif", Tahoma, Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; overflow: hidden; background: #23618e; image-rendering: pixelated; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.desktop { width: 100%; height: 100%; display: grid; place-items: center; padding: 6px; background: linear-gradient(135deg, #2b72a6, #184568); }
.game-window { width: min(99vw, calc(99vh * 4 / 3)); aspect-ratio: 4 / 3; display: grid; grid-template-rows: 4.3% 4.2% minmax(0, 1fr) clamp(22px, 3.1vw, 34px); overflow: hidden; color: #050505; background: #c9c7bc; border: 3px outset #e5e3da; box-shadow: 0 6px 22px #06243ccc; }
.os-titlebar { min-height: 0; display: flex; align-items: center; gap: 6px; padding: 2px 3px; color: #eee; background: linear-gradient(90deg, #050505, #4c4c4c); font-size: clamp(9px, 1.2vw, 15px); letter-spacing: .16em; }
.app-icon { width: 18px; height: 18px; display: grid; place-items: center; color: #111; background: #d1b04f; border: 2px outset #f5d97c; font: bold 12px Georgia, serif; letter-spacing: 0; }
.window-buttons { margin-left: auto; display: flex; gap: 2px; }
.window-buttons i { width: 18px; height: 17px; display: grid; place-items: center; color: #111; background: #c7c5ba; border: 2px outset #eee; font-size: 10px; font-style: normal; letter-spacing: 0; }
.menu-strip { min-height: 0; display: flex; align-items: center; gap: 1px; padding: 1px 5px; background: #d4d2c7; border-bottom: 2px inset #eee; }
.menu-strip button { padding: 2px 8px; color: #111; background: transparent; border: 0; font-size: clamp(9px, 1vw, 13px); }
.menu-strip button:hover, .menu-strip button:focus-visible { color: #fff; background: #000080; }
.content-links { display: flex; gap: 8px; margin-left: 8px; font-size: clamp(7px, .82vw, 11px); }
.content-links a { color: #111; text-underline-offset: 2px; }
.content-links a:hover, .content-links a:focus-visible { color: #fff; background: #000080; outline: 1px dotted #ffff9a; }
#build-label { margin-left: auto; color: #4a4a44; font-size: clamp(6px, .72vw, 10px); letter-spacing: .1em; }

.title-stage { position: relative; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; align-content: center; justify-items: center; gap: clamp(6px, 1.4vh, 18px); padding: clamp(8px, 2.2vh, 26px) 10px clamp(6px, 1.4vh, 14px); overflow: hidden; background: #14120f; border: 2px inset #777; }
.stage-plate { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; image-rendering: pixelated; filter: contrast(1.02) saturate(.66) brightness(.5); }
.stage-scrim { position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 42%, #0d0b0833 0%, #07060499 58%, #030202 100%); }
.title-stage::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 2px, #00000012 3px); box-shadow: inset 0 0 14px #000a; }

.title-lockup { position: relative; z-index: 2; text-align: center; animation: titleIn 1.1s ease both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.over-title { margin: 0; color: #9c8f6d; font-size: clamp(6px, .78vw, 10px); letter-spacing: .34em; text-shadow: 1px 1px #000; }
.title-lockup h1 { margin: clamp(1px, .5vh, 6px) 0; font: normal clamp(30px, 6.4vw, 88px)/1 Georgia, "Times New Roman", serif; letter-spacing: .015em; color: #f0d489; background: linear-gradient(#fdf0c0 8%, #e6b955 52%, #9c6f27 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(2px 3px 0 #12100b) drop-shadow(0 0 16px #00000099); }
.under-title { margin: 0; padding-top: clamp(2px, .7vh, 7px); color: #cbbf9c; font-size: clamp(7px, 1.05vw, 14px); letter-spacing: .42em; text-shadow: 1px 1px #000; border-top: 1px solid #6d5c37; }
.search-description { max-width: 620px; margin: clamp(4px, .8vh, 9px) auto 0; color: #ddd3b8; font-size: clamp(7px, .85vw, 11px); letter-spacing: .04em; line-height: 1.35; text-shadow: 1px 1px #000; }

.main-menu { position: relative; z-index: 2; align-self: center; width: min(70%, 460px); max-height: 100%; overflow-y: auto; display: grid; align-content: start; gap: clamp(2px, .5vh, 5px); margin: 0; padding: clamp(5px, 1.1vh, 10px); list-style: none; background: #cbc9bea8; border: 3px outset #e5e3da; box-shadow: 3px 4px 0 #0009, 0 0 30px #0007; }
.menu-option { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: clamp(2px, .62vh, 6px) 9px; color: #111; background: #d6d4c9; border: 2px outset #f1f0e8; text-align: left; font-size: clamp(8px, 1.02vw, 14px); }
.menu-option b { font-weight: normal; }
.menu-option u { text-underline-offset: 2px; }
.menu-option em { margin-left: auto; color: #4d4c46; font-style: normal; font-size: clamp(6px, .74vw, 10px); white-space: nowrap; }
.menu-option:hover { background: #e2e0d5; }
.menu-option.selected { color: #fff; background: #000080; }
.menu-option.selected em { color: #b9c4ea; }
.menu-option:focus-visible { outline: 1px dotted #ffff9a; outline-offset: -4px; }
.stage-hint { position: relative; z-index: 2; margin: 0; color: #a1977c; font-size: clamp(6px, .76vw, 10px); letter-spacing: .2em; text-shadow: 1px 1px #000; }

.intro-panel { position: absolute; left: 50%; top: 50%; z-index: 20; width: min(74%, 620px); max-height: 88%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; transform: translate(-50%, -50%); color: #fff; background: #24248f; border: 3px outset #dadada; box-shadow: 3px 4px 0 #0008; font-size: clamp(8px, .95vw, 12px); }
.intro-panel > header { display: flex; justify-content: space-between; padding: 2px 4px; background: linear-gradient(90deg, #05056e, #194a9d); font-weight: bold; }
.intro-panel > header button { width: 18px; padding: 0; color: #111; background: #c7c5ba; border: 2px outset #fff; }
.intro-panel > footer { display: flex; justify-content: center; gap: 8px; padding: 8px; background: #c7c5ba; }
.intro-panel > footer button, .notice-window button { min-width: 78px; padding: 3px 9px; color: #111; background: #d3d1c7; border: 2px outset #eee; }
.panel-body { min-height: 0; overflow: auto; padding: clamp(9px, 1.6vw, 18px); color: #111; background: #e3e1d6; line-height: 1.42; }
.panel-body h3 { margin: 0 0 6px; font: bold clamp(12px, 1.45vw, 18px) Georgia, serif; }
.panel-body h4 { margin: 12px 0 3px; font: bold clamp(9px, 1vw, 12px) Georgia, serif; }
.panel-body p { margin: 4px 0; }
.panel-body ul { margin: 4px 0; padding-left: 18px; }
.panel-body li { margin: 2px 0; }
.panel-body a { color: #000080; }
.panel-body dl { margin: 0; }
.panel-body dl div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dotted #8b8a80; }
.panel-body dd { margin: 0; font-weight: bold; }
.panel-body .record-rank { margin: 9px 0 0; padding: 5px; background: #fff; border: 2px inset #aaa; text-align: center; font: clamp(11px, 1.3vw, 16px) Georgia, serif; }
.panel-body form { display: grid; gap: 7px; }
.panel-body label { display: grid; grid-template-columns: 118px 1fr; align-items: center; }
.panel-body input { min-width: 0; padding: 3px; border: 2px inset #eee; }
.panel-body .fine-print { margin-top: 8px; color: #444; font-size: clamp(7px, .8vw, 10px); }

.notice-window { position: absolute; left: 50%; top: 50%; z-index: 30; width: min(46%, 380px); padding: 28px 14px 12px; transform: translate(-50%, -50%); color: #fff; background: #25258a; border: 3px outset #ddd; box-shadow: 3px 4px #0008; text-align: center; font-size: clamp(8px, .95vw, 12px); }
.notice-actions { display: flex; justify-content: center; gap: 9px; margin-top: 20px; }

.status-line { min-width: 0; display: flex; align-items: center; gap: 3px; padding: 3px 4px; color: #111; background: #d5d3c7; border-top: 2px outset #f2f1e9; }
.status-line > span { min-width: 0; flex: 1; overflow: hidden; padding: 0 5px; color: #333; font-size: clamp(7px, .77vw, 10px); text-overflow: ellipsis; white-space: nowrap; }
.status-line button { height: 100%; padding: 0 7px; background: #d5d3c8; border: 2px outset #eee; font-size: clamp(7px, .75vw, 10px); white-space: nowrap; }

@media (max-width: 680px) {
  .desktop { padding: 0; }
  .game-window { width: 100vw; height: 100dvh; aspect-ratio: auto; grid-template-rows: 28px 26px minmax(0, 1fr) 29px; }
  .os-titlebar { font-size: 10px; }
  .menu-strip button { padding: 2px 4px; font-size: 9px; }
  .content-links { gap: 5px; margin-left: 3px; font-size: 8px; }
  .content-links a:nth-child(2) { display: none; }
  #build-label { font-size: 7px; }
  .title-lockup h1 { font-size: 42px; }
  .under-title { font-size: 9px; letter-spacing: .3em; }
  .main-menu { width: 92%; }
  .menu-option { font-size: 11px; }
  .menu-option em { display: none; }
  .stage-hint { display: none; }
  .intro-panel { width: 92%; max-height: 92%; }
  .panel-body label { grid-template-columns: 1fr; }
}
