* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f5f5f5; color: #222; }
button, input, select { font: inherit; }
.app-shell { max-width: 760px; margin: 0 auto; padding: 18px 14px 40px; }
.header { padding: 8px 0 18px; }
.brand { font-size: 1.35rem; font-weight: 800; }
.subtitle, .muted { color: #666; }
.card { background: white; border: 1px solid #ddd; border-radius: 12px; padding: 16px; margin: 12px 0; }
.entry-card { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.entry-card:hover { border-color: #aaa; }
h2 { margin: 0 0 10px; font-size: 1.15rem; }
.description { color: #555; line-height: 1.45; }
.entry-number { font-weight: 800; font-size: .88rem; }
.contestant { font-weight: 700; margin-top: 3px; }
.dish { margin-top: 2px; }
.status { white-space: nowrap; font-size: .82rem; font-weight: 700; }
.scored { color: #176b38; }
.not-scored { color: #777; }
.score-row { padding: 13px 0; border-bottom: 1px solid #eee; }
.score-label { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.score-value { min-width: 22px; text-align: right; }
.score-buttons { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.score-buttons button { min-height: 44px; border: 1px solid #ccc; background: #fafafa; border-radius: 8px; cursor: pointer; }
.score-buttons button.selected { border: 2px solid #222; background: #eee; font-weight: 800; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; padding: 16px 0; }
.checkbox-row input { width: 22px; height: 22px; }
.total { font-size: 1.25rem; font-weight: 800; padding: 14px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
button.primary, button.secondary, .back { border-radius: 8px; min-height: 44px; padding: 9px 14px; cursor: pointer; }
button.primary { background: #222; color: white; border: 1px solid #222; font-weight: 800; }
button.secondary, .back { background: white; color: #222; border: 1px solid #bbb; }
button.small { min-height: 38px; padding: 7px 10px; }
.error { border-color: #d88; background: #fff7f7; }
.success { border-color: #9ac7a9; background: #f5fff7; }
label { display: block; font-weight: 700; }
label input, label select { display: block; width: 100%; margin-top: 6px; min-height: 44px; border: 1px solid #bbb; border-radius: 8px; padding: 8px 10px; background: white; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-toolbar, .admin-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.stat-card { background: white; border: 1px solid #ddd; border-radius: 10px; padding: 12px; }
.stat-number { font-size: 1.45rem; font-weight: 800; }
.admin-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; border-top: 1px solid #eee; padding: 14px 0; }
.admin-row:first-of-type { border-top: 0; }
.judge-row { align-items: flex-start; }
.judge-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.judge-link { display: flex; gap: 7px; margin-top: 9px; }
.judge-link input { min-height: 40px; min-width: 0; flex: 1; border: 1px solid #bbb; border-radius: 7px; padding: 7px; font-size: .8rem; }
.qr-wrap { margin-top: 10px; }
.qr-wrap canvas { max-width: 180px; height: auto; border: 1px solid #eee; }
@media (max-width: 600px) { .form-grid, .stats-grid { grid-template-columns: 1fr 1fr; } .score-buttons { gap: 4px; } .score-buttons button { min-height: 40px; padding: 0; } .admin-row { flex-direction: column; } .judge-actions { justify-content: flex-start; } }
@media (max-width: 420px) { .form-grid, .stats-grid { grid-template-columns: 1fr; } .score-buttons { grid-template-columns: repeat(5, 1fr); } .admin-toolbar, .admin-list-heading { align-items: flex-start; flex-direction: column; } }
@media print { body { background: white; } .header, .admin-toolbar, .stats-grid, .card form, .admin-row > .judge-actions, #logoutAdmin, #printQrs, .judge-link, .success, .error { display: none !important; } .app-shell { max-width: none; padding: 0; } .card { border: 0; margin: 0; padding: 8px 0; } .qr-wrap { display: inline-block !important; } .judge-row { break-inside: avoid; } }
.results-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.results-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.results-table th, .results-table td { border-bottom: 1px solid #eee; padding: 10px 8px; text-align: left; vertical-align: top; }
.results-table th { font-size: .8rem; color: #666; white-space: nowrap; }
.results-table td:nth-child(5), .results-table td:nth-child(6), .results-table td:nth-child(7) { white-space: nowrap; }
.detail-row td { background: #fafafa; }
.detail-table { min-width: 680px; font-size: .88rem; }
.results-detail { padding: 4px 0 8px; }
@media print { .results-card { display: block !important; } .results-card .admin-list-heading button, .results-card .results-table button { display: none !important; } }

.registration-links { margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }
.registration-links h3 { margin: 0 0 6px; font-size: 1rem; }
.public-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 12px; }
.registration-closed { margin-top: 12px; }
.public-link-row label { min-width: 0; }
@media (max-width: 420px) { .public-link-row { grid-template-columns: 1fr; } }

.danger { background: #fff0f0; color: #a40000; border: 1px solid #d66; }
.danger:hover { background: #ffe2e2; }

.landing-hero { text-align: center; padding: 28px 12px 18px; }
.landing-icon { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.landing-hero h1 { margin: 0; font-size: 1.9rem; }
.landing-event { margin: 8px 0 4px; font-size: 1.15rem; font-weight: 800; }
.landing-actions { display: grid; gap: 12px; margin: 8px 0 18px; }
.landing-button { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: 12px; text-decoration: none; border: 1px solid #bbb; }
.landing-button.primary { background: #222; color: white; border-color: #222; }
.landing-button.secondary { background: white; color: #222; }
.landing-button strong, .landing-button small { display: block; }
.landing-button small { margin-top: 3px; opacity: .75; }
.landing-button-icon { font-size: 1.45rem; width: 32px; text-align: center; }
.landing-admin { text-align: center; padding: 8px 0 20px; }
.landing-admin a { color: #555; text-decoration: none; font-size: .9rem; }
@media (hover: hover) and (pointer: fine) {
  .landing-button:hover { border-color: #888; }
  .landing-button.primary:hover { background: #333; }
}
