* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0b1020; color: #e8edff; font-family: system-ui, -apple-system, Arial, sans-serif; }
body { display: flex; flex-direction: column; padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom); -webkit-user-select: none; user-select: none; touch-action: manipulation; overflow: hidden; }
header { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 6px 52px; min-height: 48px; }
#brand { font-size: 20px; letter-spacing: 1px; }
.langbtn { background: #1b2748; color: #cfd8f5; border: 2px solid #34437a; border-radius: 8px; font: bold 14px Arial, sans-serif; padding: 6px 10px; margin-left: 6px; }
.langbtn.sel { background: #3d6dff; color: #fff; border-color: #8fb0ff; }
.hidden { display: none !important; }
.msg { min-height: 0; text-align: center; color: #ffb4b4; font-size: 15px; padding: 0 4px; }
.msg:not(:empty) { padding: 6px 4px; }
.panel { padding: 8px 4px; display: flex; flex-direction: column; gap: 8px; }
label { font-size: 14px; color: #8f9bc7; margin-top: 6px; }
input { font-size: 22px; padding: 12px; border-radius: 10px; border: 2px solid #34437a; background: #121a36; color: #fff; -webkit-user-select: text; user-select: text; text-transform: none; }
#room { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 30px; }
.big { margin-top: 14px; padding: 18px; font-size: 22px; font-weight: bold; color: #fff; background: #2fbf5b; border: 0; border-radius: 14px; }
.who { color: #8f9bc7; font-size: 15px; min-height: 20px; }
#wait-text { font-size: 20px; margin: 10px 0 0; }
.status { display: flex; align-items: center; gap: 10px; padding: 4px; font-size: 16px; }
#st-name { font-weight: bold; }
#st-info { flex: 1; color: #aeb9e0; text-align: right; }
#nx { background: #121a36; border-radius: 6px; width: 48px; height: 30px; }
#pad { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.pad { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.3fr 1.3fr 1fr; gap: 10px; min-height: 0; padding-bottom: 6px; }
.b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 18px; background: #1d2a55; color: #fff; font-weight: bold; font-size: 17px; touch-action: none; }
.b i { font-style: normal; font-size: 44px; line-height: 1; }
.b:active, .b.down { background: #3d6dff; }
.b.rot { grid-column: 1 / 3; background: #3b2a6e; }
.b.rot:active, .b.rot.down { background: #8a4dff; }
.b.hard { background: #6b2430; }
.b.hard:active, .b.hard.down { background: #ff4545; }
.b.soft { background: #1f4a3a; }
.b.soft:active, .b.soft.down { background: #2fbf5b; }
.over { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(8, 12, 28, 0.88); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 30px; font-weight: bold; text-align: center; padding: 20px; }
.opts { display: flex; gap: 8px; padding: 8px 0 10px; }
.chip { flex: 1; padding: 10px 6px; border-radius: 10px; border: 2px solid #34437a; background: #121a36; color: #cfd8f5; font-size: 14px; }
.chip.on { background: #1f4a3a; border-color: #2fbf5b; color: #fff; }
@media (orientation: landscape) and (max-height: 520px) {
  .pad { grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr; }
  .b.rot { grid-column: auto; }
  .b i { font-size: 36px; }
  header { min-height: 36px; padding-top: 2px; padding-bottom: 2px; }
}
