
:root {
  --ink: #1b2236;
  --ink-2: #262e47;
  --paper: #eceae5;
  --concrete: #d0cbc7;
  --coral: #f4a6a0;
  --butter: #f2d58b;
  --mint: #9ed3b8;
  --peri: #9cb8f0;
  --font: "Bricolage Grotesque", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 16px 32px; background: var(--ink); color: var(--paper); font-family: var(--font); line-height: 1.5; }

.header, .topnav, .row, .footer { max-width: 980px; margin-left: auto; margin-right: auto; }

/* Header: title on the left, a stack of shrinking blocks on the right */
.header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 56px 0 32px; text-align: left; background: none; }
.header h1 { margin: 0 0 12px; font-size: clamp(44px, 9vw, 88px); line-height: .95; font-weight: 800; letter-spacing: -0.03em; }
.header p { margin: 0 0 8px; max-width: 52ch; font-size: 18px; color: #c9ccd8; }
.header .howto { font-size: 15px; color: #9ea4b8; }
.header .howto strong { color: var(--paper); font-weight: 600; }

.tower { display: flex; flex-direction: column-reverse; flex: none; width: 150px; }
.tower i { display: block; height: 22px; margin-top: 4px; border-radius: 2px; }
.tower i:nth-child(1) { width: 150px; background: var(--peri); }
.tower i:nth-child(2) { width: 128px; margin-left: 14px; background: var(--mint); }
.tower i:nth-child(3) { width: 104px; margin-left: 2px;  background: var(--butter); }
.tower i:nth-child(4) { width: 84px;  margin-left: 24px; background: var(--coral); }
.tower i:nth-child(5) { width: 60px;  margin-left: 18px; background: var(--paper); }

/* Navigation */
.topnav { overflow: hidden; border-top: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); background: none; }
.topnav a { float: left; display: block; padding: 14px 18px 14px 0; margin-right: 18px; color: var(--paper); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.topnav a:hover { border-bottom-color: var(--butter); background: none; color: var(--paper); }
.topnav a:focus-visible, #container:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }

.row:after { content: ""; display: table; clear: both; }
.leftcolumn { width: 100%; }

/* Game frame: hard offset shadow instead of a soft blur */
#container {
  position: relative; width: 100%; height: 540px; overflow: hidden; margin-top: 32px;
  background: var(--concrete); color: var(--ink);
  border: 3px solid var(--paper); border-radius: 6px; box-shadow: 10px 10px 0 var(--peri);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer;
}
#game { position: absolute; inset: 0; }
#score { position: absolute; top: 14px; width: 100%; text-align: center; font-size: 72px; font-weight: 800; line-height: 1; pointer-events: none; }
#instructions { position: absolute; bottom: 16px; width: 100%; text-align: center; font-weight: 600; opacity: 0; transition: opacity .5s; pointer-events: none; }
#container.playing #instructions { opacity: 1; }
#container.playing #instructions.hide { opacity: 0; }

.game-over, .game-ready { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; pointer-events: none; transition: opacity .35s; }
.game-over { background: rgba(236, 234, 229, .88); }
.game-over h2 { margin: 0 0 8px; font-size: 48px; font-weight: 800; letter-spacing: -0.02em; }
.game-over p { margin: 2px 0; font-size: 18px; }
#container.ended .game-over, #container.ready .game-ready { opacity: 1; }
#start-button { padding: 14px 40px; font: 800 26px var(--font); color: var(--paper); background: var(--ink); border-radius: 4px; box-shadow: 6px 6px 0 var(--coral); transition: transform .12s, box-shadow .12s; }
#container:hover #start-button { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--coral); }

/* Footer */
.footer { clear: both; position: static; margin-top: 56px; padding: 28px 0 0; text-align: left; background: none; border-top: 6px solid transparent; border-image: linear-gradient(90deg, var(--peri) 0 20%, var(--mint) 20% 40%, var(--butter) 40% 60%, var(--coral) 60% 80%, var(--paper) 80% 100%) 1; }
.footer h2 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.footer p { margin: 4px 0; color: #c9ccd8; }
.footer .copy { font-size: 13px; color: #8e94aa; }

@media (max-width: 700px) {
  .header { flex-direction: column; align-items: flex-start; padding-top: 36px; }
  .tower { width: 120px; transform: scale(.8); transform-origin: left bottom; }
  #container { height: 420px; box-shadow: 6px 6px 0 var(--peri); }
  #score { font-size: 56px; }
}
@media (max-width: 400px) { .topnav a { float: none; width: 100%; margin-right: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
