/* Shell Shock. The SoSmarty look (base.css) on an orange ground; design rules live in the repo's CLAUDE.md. */
:root { --orange: #f28c38; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--orange); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.screen { position: fixed; inset: 0; }
canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
body.touch .keys { display: none; }

/* Title: name, a still picture of the table, the way in */
.title { display: flex; flex-direction: column; gap: 20px; padding: max(7vh, env(safe-area-inset-top)) max(6vw, 16px) max(5vh, env(safe-area-inset-bottom)); }
.title h1 { font-size: 64px; line-height: 0.95; }
.title h1 span { display: block; }
.tagline { margin: 12px 0 0; font-size: 20px; font-weight: 700; }
.art { position: relative; flex: 1 1 auto; min-height: 140px; }
.title-bottom { display: flex; flex-direction: column; gap: 16px; }
.keys { margin: 0; font-size: 16px; }
@media (max-height: 640px) and (orientation: portrait) {
  .title { gap: 12px; padding-top: max(16px, env(safe-area-inset-top)); }
  .title h1 { font-size: 48px; }
  .title .btn { font-size: 18px; padding: 10px 14px; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .title { display: grid; grid-template: auto 1fr auto / minmax(320px, 1fr) 1.3fr; column-gap: 48px; }
  .title-top { grid-area: 1 / 1; }
  .title-bottom { grid-area: 3 / 1; }
  .art { grid-area: 1 / 2 / 4 / 3; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .title { display: grid; grid-template: auto 1fr / 1fr 1fr; column-gap: 24px; padding-top: 16px; }
  .title h1 { font-size: 32px; }
  .title h1 span { display: inline; }
  .title-bottom { grid-area: 2 / 1; align-self: end; }
  .art { grid-area: 1 / 2 / 3 / 3; }
}

/* Cream panels: level select and the ending */
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.lvls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 640px) { .lvls { grid-template-columns: repeat(3, 1fr); } }
.lvl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 84px; padding: 10px; border: 3px solid var(--ink); border-radius: 4px;
  background: var(--ink); color: var(--cream); font: 16px/1.25 var(--body); text-align: left; cursor: pointer; }
.lvl b { margin-bottom: 4px; font: 20px/1 var(--display); font-weight: 400; }
.lvl.clean { background: var(--orange); color: var(--ink); }
.lvl:disabled { background: transparent; color: rgba(26, 22, 18, 0.55); border: 3px dashed rgba(26, 22, 18, 0.4); cursor: default; }
.stats dd.small { max-width: 22em; font: 700 20px/1.3 var(--body); }

/* Play: header, the devil's line, the table, the buttons */
.play { display: grid; grid-template: auto auto minmax(0, 1fr) auto / minmax(0, 1fr); grid-template-areas: 'hud' 'talk' 'stage' 'tools';
  gap: 10px; max-width: 900px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.hud { grid-area: hud; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hud p { margin: 0; font-size: 20px; font-weight: 700; white-space: nowrap; }
.lv { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud b { font: 20px/1 var(--display); font-weight: 400; }
.lv b { margin-right: 6px; }
.talk { grid-area: talk; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.talk img { flex: none; width: 48px; height: 48px; }
.talk p { position: relative; flex: 1 1 auto; margin: 0; padding: 8px 12px; min-height: 48px; background: var(--cream); border: 3px solid var(--ink);
  border-radius: 4px; font-size: 16px; font-weight: 700; line-height: 1.3; }
.talk p::before { content: ''; position: absolute; left: -11px; top: 14px; border: 8px solid transparent; border-right-color: var(--ink); border-left: 0; }
.showme { flex: none; background: var(--cream); color: var(--ink); font-size: 16px; padding: 10px 12px; }
.stage { grid-area: stage; position: relative; touch-action: manipulation; cursor: pointer; }
.stage.shake { animation: shake 0.32s linear; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.tools { grid-area: tools; justify-content: center; }
.tools .btn { font-size: 18px; padding: 10px 16px; }
.btn:disabled { background: transparent; color: rgba(26, 22, 18, 0.55); border: 3px dashed rgba(26, 22, 18, 0.45); cursor: default; transform: none; }

@media (max-height: 520px) and (orientation: landscape) {
  .play { max-width: none; grid-template: auto auto 1fr auto / minmax(0, 1fr) 280px; grid-template-areas: 'stage hud' 'stage talk' 'stage .' 'stage tools'; }
  .tools { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active, .lvl:hover:not(:disabled) { transform: none; }
  .stage.shake { animation: none; }
}
