/* An illustrated paper menu; all rules are scoped to the title screen. */
#top-menu{min-height:100dvh;padding:clamp(16px,3vw,48px);overflow:hidden;color:#3d3a2d;background:#f1ebda}
#top-menu .menu-world{inset:0;opacity:1;filter:none;background:url('assets/menu-handdrawn.png') center/cover no-repeat}
#top-menu::after{background:linear-gradient(90deg,transparent 40%,#f5efdf1a 59%,#f5efdf40)}
#top-menu .menu-panel{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(310px,.85fr);align-items:center;width:min(1180px,100%);min-height:min(670px,calc(100dvh - clamp(32px,6vw,96px)));gap:clamp(26px,6vw,100px);padding:0;border:0;border-radius:0;background:none;box-shadow:none;max-height:none}
#top-menu .menu-title{display:flex;flex-direction:column;align-self:stretch;align-items:flex-start;position:relative;min-height:0;padding:4px 0;overflow:visible;border:0;border-radius:0;background:none}
#top-menu .menu-title h1{font-family:'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif;font-size:clamp(40px,5.5vw,68px);font-weight:900;line-height:1.1;letter-spacing:.03em;color:#4b4231;text-align:left;transform:rotate(-2deg);-webkit-text-stroke:0;text-shadow:none}
#top-menu .menu-title h1 span{display:block;font-size:1em;line-height:1.1;letter-spacing:.03em;color:#73573a;margin:2px 0 0}
#top-menu .player-profile{margin:18px 0 0;width:min(230px,100%);color:#574e3e}
#top-menu .player-profile input{background:#fffaf0e8;border:1px solid #9b9379;color:#413c31;box-shadow:none}
#top-menu #character-unlock{background:#e7dfc8ed;color:#514831;border-color:#a19c7c}
#top-menu .menu-setup{display:flex;flex-direction:column;gap:10px;position:relative;color:#494332;padding:22px;border:1px solid #9a957d;border-radius:13px 10px 15px 9px;background:#f8f3e5ed;box-shadow:3px 4px 0 #7a76531c;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
#top-menu .edition-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:4px;background:#e7e3d3;border:1px solid #aaa58e;border-radius:7px}
#top-menu .edition-switch button{min-height:42px;font-size:15px;font-weight:700;color:#7b7865;border:1px solid transparent;border-radius:5px;background:transparent;text-shadow:none}
#top-menu .edition-switch button.selected{color:#f9f6e8;border-color:#66715a;background:#6e795d;box-shadow:none}
#top-menu #edition-note{min-height:0;max-width:none;margin:0;padding:0 2px;color:#73715d;font-size:11px;line-height:1.55}
#top-menu .mode-switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:3px;background:#ebe7d9;border:1px solid #b5b09b;border-radius:6px}
#top-menu .mode-switch button{min-height:34px;padding:5px 2px;font-size:12px;color:#7d7b68;border-radius:4px}
#top-menu .mode-switch button.selected{color:#3e4838;background:#cdd2ba;box-shadow:none}
#top-menu .stage-preview{min-height:63px;padding:9px;gap:10px;border:1px solid #b0a88d;border-radius:7px;color:#4e4936;background:#eee9d9;box-shadow:none}
#top-menu .stage-preview>img{width:69px;height:43px;border:1px solid #a49e87;border-radius:4px}
#top-menu .stage-preview strong{font-size:15px;color:#514735}
#top-menu .stage-preview small,#top-menu .stage-preview #stage-terrain{font-size:10px;color:#7a7762}
#top-menu .stage-preview .change-label{color:#7f6a43;font-size:11px}
#top-menu .menu-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));min-height:0;gap:10px}
#top-menu .menu-options label{display:flex;flex-direction:column;gap:5px;font-size:10px;color:#706b58}
#top-menu .menu-options select{min-height:35px;width:100%;padding:5px 8px;font-size:12px;color:#524c3c;background:#fffcf2;border:1px solid #a29d84;border-radius:5px;color-scheme:light}
#top-menu .menu-options p{grid-column:1/-1;color:#76705a;font-size:11px;margin:2px 0}
#top-menu .rules-preview{min-height:36px;padding:7px 10px;border:1px solid #b2aa90;border-radius:5px;color:#65604c;background:#eae7d7;font-size:12px}
#top-menu .rules-preview small{font-size:10px;color:#827961}
#top-menu .rules-preview>span:last-child{color:#92794e;font-size:20px}
#top-menu .start-btn{display:flex;justify-content:center;align-items:center;min-height:53px;padding:10px;margin:3px 0 4px;border:1px solid #987449;border-radius:7px 5px 8px 5px;background:#d1ac71;color:#3e3526;box-shadow:0 3px 0 #9b7a50;text-shadow:none;font-size:18px;font-weight:700;letter-spacing:.03em}
#top-menu .start-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #9b7a50}
#top-menu .menu-utilities{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#top-menu .menu-utilities button{min-height:28px;padding:4px 2px;color:#746e59;font-size:10px;border:1px solid #b8b19b;background:#f5f1e4;border-radius:5px}
#top-menu button:focus-visible,#top-menu input:focus-visible,#top-menu select:focus-visible{outline:3px solid #8a9e8a;outline-offset:3px}
@media(orientation:landscape) and (max-height:600px){
 #top-menu{padding:16px 22px}
 #top-menu .menu-panel{grid-template-columns:minmax(0,1fr) minmax(290px,.84fr);gap:5vw;min-height:calc(100dvh - 32px)}
 #top-menu .menu-setup{padding:13px;gap:5px;border-radius:10px}
 #top-menu .menu-title h1{font-size:clamp(36px,5.5vw,51px)}
 #top-menu .player-profile{margin-top:12px;width:min(200px,100%)}
 #top-menu .edition-switch button{min-height:32px;font-size:13px}
 #top-menu .mode-switch button{min-height:28px;font-size:11px}
 #top-menu #edition-note{font-size:10px;line-height:1.4}
 #top-menu .stage-preview{min-height:48px;padding:5px 8px}
 #top-menu .stage-preview>img{width:57px;height:34px}
 #top-menu .stage-preview strong{font-size:13px}
 #top-menu .menu-options{gap:8px}
 #top-menu .menu-options label{gap:3px;font-size:9px}
 #top-menu .menu-options select{min-height:28px;font-size:11px}
 #top-menu .rules-preview{min-height:30px;padding:4px 8px;font-size:11px}
 #top-menu .rules-preview small{font-size:9px}
 #top-menu .start-btn{min-height:43px;font-size:16px;padding:7px}
 #top-menu .menu-utilities button{min-height:24px;font-size:9px}
}
@media(orientation:landscape) and (max-height:350px){
 #top-menu{padding:9px 14px}
 #top-menu .menu-panel{grid-template-columns:minmax(0,1fr) minmax(260px,.9fr);gap:12px;min-height:calc(100dvh - 18px)}
 #top-menu .menu-setup{padding:8px;gap:3px}
 #top-menu .menu-title h1{font-size:34px}
 #top-menu .player-profile{margin-top:10px;width:min(180px,100%)}
 #top-menu .edition-switch button{min-height:27px;font-size:12px}
 #top-menu .mode-switch button{min-height:25px;font-size:10px}
 #top-menu #edition-note{font-size:9px;line-height:1.3}
 #top-menu .stage-preview{min-height:43px}
 #top-menu .stage-preview>span:nth-child(2){gap:2px}
 #top-menu .stage-preview small{font-size:9px}
 #top-menu .menu-options label{line-height:1.25}
 #top-menu .stage-preview>img{height:30px;width:48px}
 #top-menu .menu-options select{min-height:25px}
 #top-menu .rules-preview{min-height:27px}
 #top-menu .start-btn{min-height:36px;font-size:14px;margin-top:0}
 #top-menu .menu-utilities button{min-height:22px}
 .player-profile #character-unlock{position:absolute;right:0;top:-18px;padding:0 3px;font-size:9px}
}
@media(orientation:portrait){
 #top-menu{display:block;padding:22px 16px;overflow:visible}
 #top-menu .menu-world{background-size:auto max(620px,100dvh);background-position:25% top}
 #top-menu::after{background:linear-gradient(transparent 25%,#f7f0dfc9 52%,#f7f0df 85%)}
 #top-menu .menu-panel{display:flex;flex-direction:column;width:min(440px,100%);min-height:calc(100dvh - 44px);gap:0;padding:0;margin:0 auto}
 #top-menu .menu-title{width:100%;min-height:310px;padding:0 0 25px}
 #top-menu .menu-title h1{font-size:45px}
 #top-menu .player-profile{margin-top:12px;width:170px}
 #top-menu .menu-setup{width:100%;padding:16px;gap:8px}
 #top-menu .edition-switch button{min-height:37px;font-size:14px}
 #top-menu .mode-switch button{min-height:32px}
 #top-menu .stage-preview{min-height:53px}
 #top-menu .stage-preview>img{height:35px}
 #top-menu .start-btn{min-height:48px}
}

#top-menu .menu-play{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px;align-items:stretch}
#top-menu .menu-play .start-btn,#top-menu .menu-play .online-open{margin:0;min-height:46px;font-size:14px;letter-spacing:0;padding:7px 4px}
#top-menu .menu-play .online-open{background:#d9e1c9;border:1px solid #8d9a7b;border-radius:6px;color:#42513b;font-weight:700}
@media(orientation:landscape) and (max-height:600px){#top-menu .menu-play .start-btn,#top-menu .menu-play .online-open{min-height:39px;font-size:12px}#top-menu .edition-switch button{font-size:12px}}
@media(orientation:landscape) and (max-height:350px){#top-menu .menu-play .start-btn,#top-menu .menu-play .online-open{min-height:34px;font-size:11px}#top-menu .edition-switch button{font-size:11px}#top-menu .menu-title h1{font-size:32px}}
