* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: #14101f; color: #f2ecff; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; display: flex; justify-content: center; padding: 10px; }
#cabinet { width: min(520px, 100%); background: linear-gradient(180deg, #2b2145, #1b1430 60%, #241a3f); border: 3px solid #c9a227; border-radius: 18px; padding: 12px; box-shadow: 0 0 34px rgba(160, 110, 255, .35); }
button { font-family: inherit; cursor: pointer; }

/* ヘッダー */
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
#logo { text-align: center; flex: 1; }
#logo h1 { font-size: 30px; letter-spacing: .12em; background: linear-gradient(180deg, #ffe9a8, #f5b921 55%, #b97e0e); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.logo-sub { font-size: 9px; letter-spacing: .35em; color: #b7a6e8; }
.logo-sub2 { font-size: 10px; color: #d9cfff; margin-top: 2px; }
.lamp { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; border: 2px solid rgba(255,255,255,.35); transition: all .25s; }
.lamp-nana { background: radial-gradient(circle at 35% 35%, #ff9d9d, #c21725 70%); color: #fff; box-shadow: 0 0 6px rgba(255,60,80,.3); }
.lamp-ellie { background: radial-gradient(circle at 35% 35%, #a8ccff, #1c4fc2 70%); color: #fff; box-shadow: 0 0 6px rgba(70,130,255,.3); }
.lamp.on { box-shadow: 0 0 22px 6px currentColor; filter: brightness(1.5); }
.lamp-nana.on { color: #ff5b6e; } .lamp-ellie.on { color: #6ea8ff; }
.lamp.blink { animation: blink .18s steps(2) infinite; }
@keyframes blink { 50% { filter: brightness(2.1); } }

/* 液晶 */
#lcd { position: relative; height: 300px; border-radius: 12px; overflow: hidden; border: 2px solid #6f5bb5; background: #79b5e8; }
#lcdBg { position: absolute; inset: 0; transition: background 1s; }
.stage-day #lcdBg { background: linear-gradient(180deg, #8ec9f2 0%, #bfe3ff 55%, #7d9b6a 56%, #5d7d4c 100%); }
.stage-evening #lcdBg { background: linear-gradient(180deg, #f2a65e 0%, #f7cf8e 55%, #6a5a7d 56%, #4c4260 100%); }
.stage-night #lcdBg { background: linear-gradient(180deg, #101736 0%, #27336e 55%, #232038 56%, #17142a 100%); }
.stage-school #lcdBg { background: linear-gradient(180deg, #a5d8f0 0%, #d8f0ff 55%, #c9b18a 56%, #a68d63 100%); }
.stage-observatory #lcdBg { background: linear-gradient(180deg, #0d1030 0%, #342a63 60%, #1c1836 61%, #120f24 100%); }
.stage-enchant #lcdBg { background: linear-gradient(180deg, #3d1663 0%, #7b2d8b 55%, #2a1245 56%, #1d0b33 100%); }
.stage-ge #lcdBg { background: linear-gradient(180deg, #0e2a1e 0%, #1d4a33 60%, #0a1f16 61%, #06130d 100%); }
.stage-ma #lcdBg { background: linear-gradient(180deg, #0a1030 0%, #1c2a5e 55%, #141b3d 56%, #0a0e24 100%); }
.stage-es #lcdBg { background: linear-gradient(180deg, #4a0e0e 0%, #8b2323 55%, #38090f 56%, #24060c 100%); }
.stage-big #lcdBg { background: linear-gradient(180deg, #8b6a00 0%, #f5b921 55%, #8b6a00 56%, #5e4700 100%); }
.stage-art #lcdBg { background: linear-gradient(180deg, #123a6e 0%, #2d7b8b 55%, #0f2a4a 56%, #0a1d33 100%); }
.stage-battle #lcdBg { background: linear-gradient(180deg, #5e1230 0%, #8b2d5e 55%, #3d0f2a 56%, #2a0a1d 100%); }
#lcd.frozen #lcdBg { filter: grayscale(.9) brightness(1.3); }
#lcd.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.portrait { position: absolute; bottom: 64px; width: 132px; height: 168px; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
#portraitL { left: 6px; } #portraitR { right: 6px; transform: scaleX(-1); }
.portrait svg { width: 100%; height: 100%; }
.portrait img { width: 100%; height: 100%; object-fit: contain; display: block; }
#lcdTop { position: absolute; top: 8px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 3; }
#stateChip { background: rgba(10, 6, 30, .72); border: 1px solid #c9a227; color: #ffe9a8; padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: bold; }
#fraction { background: rgba(10, 6, 30, .78); border: 2px solid #7ee2ff; border-radius: 10px; padding: 2px 16px 4px; color: #fff; font-size: 30px; font-weight: bold; text-align: center; line-height: 1.05; }
#fraction .fracBar { color: #7ee2ff; margin: 0 4px; }
#fraction .fracLabel { font-size: 9px; color: #aee9ff; font-weight: normal; letter-spacing: .2em; }
#czInfo { background: rgba(10, 6, 30, .78); border: 1px solid #ff8fb2; color: #ffd7e6; border-radius: 8px; padding: 2px 12px; font-size: 14px; font-weight: bold; }
.hidden { display: none !important; }
#banner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5; background: rgba(8, 4, 24, .45); }
#bannerText { font-size: 34px; font-weight: bold; text-align: center; color: #fff; text-shadow: 0 0 14px #f5b921, 0 2px 0 #7a4d00; letter-spacing: .08em; white-space: pre-line; animation: bannerIn .3s ease-out; }
@keyframes bannerIn { from { transform: scale(.6); opacity: 0; } }
#feathers { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.feather { position: absolute; width: 13px; height: 7px; background: #fff; border-radius: 60% 40% 60% 40%; opacity: .9; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(310px) rotate(300deg); opacity: .2; } }
#msgWindow { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(12, 8, 34, .85); border: 1px solid #9d8ae0; border-radius: 10px; padding: 6px 10px 7px; z-index: 3; min-height: 52px; }
#msgName { font-size: 11px; font-weight: bold; color: #ffb3c1; }
#msgName.blue { color: #a8ccff; } #msgName.purple { color: #d3a6ff; }
#msgText { font-size: 13.5px; line-height: 1.45; }
#cycleMeter { position: absolute; right: 10px; bottom: 66px; width: 74px; height: 9px; background: rgba(10,6,30,.6); border: 1px solid #9d8ae0; border-radius: 6px; z-index: 3; }
#cycleFill { height: 100%; width: 0%; background: linear-gradient(90deg, #7ee2ff, #c792ff); border-radius: 6px; transition: width .3s; }
#cycleMeter span { position: absolute; right: 0; top: -15px; font-size: 9px; color: #cfc2ff; }

/* リール */
#reelArea { position: relative; display: flex; gap: 8px; justify-content: center; margin-top: 10px; background: linear-gradient(180deg, #0f0b20, #1d1540); border: 2px solid #57489a; border-radius: 12px; padding: 10px 8px; }
.reelWin { width: 30%; max-width: 130px; height: 168px; overflow: hidden; border-radius: 8px; background: #fdfdf8; border: 2px solid #888; position: relative; }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.sym { height: 56px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: bold; border-bottom: 1px solid #e3e3da; color: #222; }
.sym.s7 { color: #111; font-size: 36px; text-shadow: 0 0 2px #999; }
.sym.rb { background: #c21725; color: #fff; font-size: 19px; letter-spacing: .05em; border-radius: 4px; margin: 6px 4px; height: 44px; }
.sym.bb { background: #1c4fc2; color: #fff; font-size: 19px; letter-spacing: .05em; border-radius: 4px; margin: 6px 4px; height: 44px; }
.sym.rp { color: #1a9e54; font-size: 25px; }
.sym.be { color: #d9930d; }
.sym.su { color: #2e9e4f; }
.sym.ch { color: #d21f3c; }
.sym.blank { color: #b9b9ad; font-size: 22px; }
.reelGlass { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), transparent 30%, transparent 70%, rgba(0,0,0,.28)); pointer-events: none; }
#payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; background: rgba(255, 80, 80, .0); pointer-events: none; }
#payline.flash { background: rgba(255, 80, 80, .85); box-shadow: 0 0 8px #ff5050; }

/* メーター・操作 */
#meters { display: flex; gap: 6px; margin-top: 10px; }
.meter { flex: 1; background: #0d0a1c; border: 1px solid #57489a; border-radius: 8px; text-align: center; padding: 4px 2px 6px; }
.meter label { font-size: 9px; color: #9d8ae0; letter-spacing: .15em; }
.meter div { font-size: 19px; font-weight: bold; font-variant-numeric: tabular-nums; color: #aef2c1; }
#controls { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
#btnLever { width: 92px; border-radius: 12px; border: 2px solid #8a6d1a; background: linear-gradient(180deg, #ffd964, #d99a12); color: #4a3200; font-size: 17px; font-weight: bold; box-shadow: 0 4px 0 #8a6d1a; }
#btnLever:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6d1a; }
#btnLever:disabled { filter: grayscale(.7); opacity: .55; }
#stopBtns { flex: 1; display: flex; gap: 8px; }
.stopBtn { flex: 1; height: 62px; border-radius: 50%; border: 3px solid #7a1f2b; background: radial-gradient(circle at 35% 30%, #ff8f9d, #c21725 65%, #8f0f1c); color: #fff; font-size: 16px; font-weight: bold; box-shadow: 0 4px 0 #5e0a14; }
.stopBtn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #5e0a14; }
.stopBtn:disabled { filter: grayscale(.8); opacity: .45; }
#subControls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: space-between; }
.ctlGroup { display: flex; gap: 6px; align-items: center; }
.ctlLabel { font-size: 11px; color: #b7a6e8; }
.aimBtn, .toggleBtn { background: #241a4a; color: #d9cfff; border: 1px solid #57489a; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.aimBtn.active { background: #6d1f8f; border-color: #c792ff; color: #fff; font-weight: bold; }
.toggleBtn.on { background: #1c6e46; border-color: #4ecb71; color: #fff; }

/* パネル */
#panels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.panel { background: rgba(13, 10, 28, .7); border: 1px solid #57489a; border-radius: 10px; padding: 9px 11px; }
.panel h2 { font-size: 12.5px; color: #ffe9a8; margin-bottom: 7px; letter-spacing: .06em; }
.dataGrid { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 12px; color: #cfc2ff; }
.dataGrid b { color: #fff; float: right; font-variant-numeric: tabular-nums; }
#settingBtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#settingBtns button { background: #241a4a; color: #d9cfff; border: 1px solid #57489a; border-radius: 8px; padding: 8px 0; font-size: 13px; }
#settingBtns button.active { background: #8b6a00; border-color: #f5b921; color: #fff; font-weight: bold; }
.note { font-size: 10.5px; color: #9d8ae0; margin-top: 7px; line-height: 1.5; }
#help { margin-top: 12px; background: rgba(13,10,28,.7); border: 1px solid #57489a; border-radius: 10px; padding: 9px 11px; }
#help summary { font-size: 12.5px; color: #ffe9a8; cursor: pointer; }
.helpBody { font-size: 12px; line-height: 1.7; color: #d9cfff; margin-top: 8px; }
.helpBody p { margin-bottom: 8px; }
@media (max-width: 560px) { #panels { grid-template-columns: 1fr; } #logo h1 { font-size: 24px; } .portrait { width: 104px; height: 132px; } }
