* { box-sizing: border-box; }
:root { font-family: system-ui, "Malgun Gothic", sans-serif; color: #151b29; background: #f4f2ed; }
body { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.masthead { background: #151b29; color: #fff; }
.brand { display: flex; align-items: center; gap: clamp(.65rem, 2.5vw, 1.25rem); padding-block: .9rem; }
.brand-logo { display: block; flex: 0 0 auto; width: clamp(4.75rem, 18vw, 7.25rem); height: auto; }
.brand span { min-width: 0; font-size: clamp(.875rem, 2.2vw, 1.125rem); font-weight: 750; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
main { padding-bottom: calc(8rem + env(safe-area-inset-bottom)); }
.intro { padding-block: clamp(1.75rem, 5vw, 4rem) 1.5rem; }
h1 { margin: 0; font-size: clamp(2.15rem, 6vw, 4.5rem); line-height: 1.08; letter-spacing: -.07em; }
p { line-height: 1.55; }
#instruction { margin: .8rem 0 0; color: #484c57; }
#notice { background: #fff; padding: .85rem 1rem; border-left: .25rem solid #3e6614; border-radius: .4rem; }
.entries { display: grid; gap: clamp(.55rem, 2vw, 1.15rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, max(8rem, 23%)), 1fr)); }
.entries.match { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.entries.result { grid-template-columns: minmax(0, 34rem); }
.card { position: relative; width: 100%; display: block; background: #fff; border: 2px solid #d9d7d0; border-radius: .9rem; overflow: hidden; padding: 0; text-align: left; color: inherit; font: inherit; }
button.card { cursor: pointer; }
button.card:hover { border-color: #546e34; }
.card[aria-pressed="true"] { border-color: #315700; box-shadow: inset 0 0 0 1px #315700; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #e6e8ed; }
.card span { display: block; padding: .7rem .6rem; font-size: .95rem; font-weight: 750; overflow-wrap: anywhere; }
.card[aria-pressed="true"] span::after { content: " ✓"; color: #315700; }
button:focus-visible { outline: 3px solid #476d12; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .52; }
.primary { min-height: 3rem; background: #cbff63; color: #151b29; font: inherit; font-weight: 800; border: 1px solid transparent; border-radius: .55rem; padding: .55rem 1.25rem; cursor: pointer; }
.standalone { margin-top: 1rem; border-color: #496a25; }
footer { position: fixed; z-index: 2; bottom: 0; inset-inline: 0; background: #151b29; color: #fff; padding: .7rem 0 calc(.7rem + env(safe-area-inset-bottom)); }
.tray-inner { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-weight: 750; }
.entry { min-width: 0; align-self: start; }
.photo-open { display: block; width: 100%; min-height: 2.75rem; border: 0; border-radius: .45rem; background: transparent; color: #34500f; font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.photo-open:hover { text-decoration: underline; }
#photos { width: min(94vw, 60rem); max-height: 94dvh; padding: clamp(.6rem, 2vw, 1rem); color: #151b29; border: 0; border-radius: .8rem; }
#photos::backdrop { background: rgb(15 20 28 / .82); }
.photo-header, .photo-controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.photo-header h2 { margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
#photos button { min-height: 2.75rem; padding: .35rem .6rem; border: 1px solid #adb1b8; border-radius: .45rem; color: inherit; background: #fff; font: inherit; cursor: pointer; }
#photo-image { display: block; width: 100%; max-height: 65dvh; object-fit: contain; margin-block: .65rem; background: #151b29; border-radius: .4rem; }
#photo-count { margin-inline: auto; }
@media (max-width: 37.5rem) {
  .entries.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card span { padding: .45rem .5rem; }
}

