* { box-sizing: border-box }
body { margin: 0; min-height: 100vh; color: #402f32; background: #fbf5f5; font: 1rem/1.5 system-ui, sans-serif }
header, main { width: min(94%, 850px); margin: auto }
header { display: flex; justify-content: space-between; align-items: center; padding: 1.4rem 0; border-bottom: 1px solid #d5c9c8 }
header a, header button { color: inherit; font: inherit }
header form { display: flex; align-items: center; gap: .75rem }
header button { background: transparent; border: 0; text-decoration: underline; cursor: pointer }
main { padding: clamp(1rem, 5vh, 4rem) 0 }
canvas { display: block; width: 100%; background: #eadfdd; border: 2px solid #594246; border-radius: 12px }
canvas { aspect-ratio: 480 / 210; height: auto; image-rendering: pixelated; cursor: pointer; touch-action: manipulation }
.actions button { font: 600 1rem/1.3 system-ui; color: #fffaf3; background: #80585f; border: 0; border-radius: 8px; padding: .8rem 1.15rem; cursor: pointer; text-decoration: none }
.actions button:disabled { opacity: .6 }
[hidden] { display: none !important }

#status:empty { display: none }
.actions { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 145px),1fr)); gap: .8rem }
.actions button {
  color: #573f43; background: #f1e2e2; border: 1px solid #ddc7c9;
  border-radius: 12px; box-shadow: 0 2px 0 #ddc7c9; transition: background .15s, box-shadow .15s;
}
.actions button[data-action="walk"] { background: #80565e; color: white; border-color: #80565e }
.actions button:hover { background: #e9d3d5 }
.actions button[data-action="walk"]:hover { background: #6d464e }
.actions button:active { box-shadow: none }
header .back-link {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 42px; padding: .5rem 1rem;
  color: #5e4449; background: #f0e2e2; border: 1px solid #e2ced0; border-radius: 12px;
  font-weight: 600; text-decoration: none;
}
header .back-link:hover { background: #ead6d7 }
.back-link:focus-visible, .actions button:focus-visible { outline: 3px solid #956a72; outline-offset: 3px }

.ranking { margin-top: 2rem }
.ranking h2 { font-size: 1.35rem }
.ranking table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums }
.ranking th, .ranking td { padding: .6rem .8rem; border-bottom: 1px solid #d5c9c8 }
.ranking th:last-child, .ranking td:last-child { text-align: right }
.my-record { background: #f2e4e6 }

.login-page {
  background: radial-gradient(ellipse at 50% 55%, #f1e4e6, transparent 56%), #faf7f5;
  color: #38252d;
  font-family: Inter, system-ui, sans-serif;
}
.login-page header { border-color: #e4d8da }
.login-page header a { text-decoration: none }

.login-page main { min-height: 78svh; display: grid; align-content: center; justify-items: center; padding: 6rem 0 3rem }
.login-page [role="alert"] { margin: 0 0 5rem }
.gate {
  position: relative; width: min(100%, 580px);
  padding: clamp(12px, 3.5vw, 32px);
  border: 1px solid #e6d9db; border-radius: 22px;
  background: #fffdfa; box-shadow: 0 16px 50px #54253710;
}
.patrick-ears {
  position: absolute; bottom: 100%; right: 30px;
  width: 100px; height: 30px; pointer-events: none;
  background: url("../img/patrick.png") -71px -6px / 180px auto no-repeat;
}
.gate p { margin: 0 0 1.25rem; font-size: 1.1rem; line-height: 1.45 }
.gate .gate-prompt { font-size: 1rem; font-weight: 600; text-align: center; text-wrap: balance }
.login {
  display: flex; justify-content: center; align-items: center; gap: .65rem;
  padding: .85rem 1rem; border-radius: 12px; background: #67454d; color: white;
  font-weight: 600; text-decoration: none;
}
.login:hover { background: #583b43 }
.login:focus-visible { outline: 3px solid #965472; outline-offset: 4px }
