* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; padding: 20px 24px 12px; background: #101110; overflow: hidden; }
header { text-align: center; padding: 4px 0 24px; }
body.no-title header { display: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#boardTitle { background: none; border: 0; text-transform: uppercase; font-size: clamp(20px, 3vw, 48px); font-weight: 700; letter-spacing: .15em; }
#boardFrame { flex: 1; min-height: 0; position: relative; overflow: hidden; }
#board { margin: 0; transform-origin: top left; position: absolute; }
#columns, .splitflap .row { display: flex; gap: 24px; }
#columns { color: #b4b5ac; font-size: 26px; font-weight: 600; letter-spacing: 3px; padding: 12px 0 20px; border-bottom: 2px solid #42433a; }
.tap-heading-random { cursor: pointer; border-radius: 4px; transition: color .15s; }
.tap-heading-random:hover, .tap-heading-random:focus-visible { color: #e8df70; outline: none; }
.splitflap .row { height: var(--row-height, 112px); padding: 17px 0 12px; border-bottom: 2px solid #292b25; align-items: center; overflow: hidden; }
/* Fewer taps means more room per row; scale just the flap-letter content (not the
   row box itself) up to fill it, instead of leaving dead space above the divider. */
.row-content { display: flex; gap: 24px; align-self: flex-start; transform: scaleY(var(--content-scale, 1)); transform-origin: top; }
.splitflap .group { float: none; margin: 0; display: flex; width: max-content; }
.cell { flex-shrink: 0; overflow: hidden; }
.location { font-family: monospace; font-size: 24px; letter-spacing: 1px; color: #a6a79e; margin-top: 10px; white-space: nowrap; }
.splitflap .full { flex: 0 0 25px; position: relative; }
.splitflap .full span.glyph { background: linear-gradient(#20201b 48%, #080908 49%, #080908 52%, #191a16 53%); color: #dbc97e; font: bold 34px/40px monospace; text-align: center; }
#menuToggle { position: fixed; z-index: 21; top: 22px; right: 24px; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid #4d503e; border-radius: 50%; background: #20231bed; color: #e8df94; box-shadow: 0 4px 20px #0004; transition: opacity .25s, background .2s, transform .2s; }
#menuToggle:hover, #menuToggle[aria-expanded="true"] { background: #393d29; border-color: #a59b59; }
#menuToggle[aria-expanded="true"] svg { transform: rotate(90deg); }
#menuToggle svg { transition: transform .2s; }
#controls { position: fixed; z-index: 20; top: 82px; right: 24px; width: 350px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 98px); overflow-y: auto; border: 1px solid #454938; border-radius: 18px; background: linear-gradient(145deg, #25281ff5, #171a15fa); backdrop-filter: blur(18px); box-shadow: 0 18px 60px #0009; color: #eeeede; font-size: 14px; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-12px) scale(.98); transform-origin: top right; transition: opacity .2s, transform .2s, visibility .2s; }
#controls.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 22px 20px; }
.panel-eyebrow { margin: 0 0 7px; font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #a9ae92; }
#controlsTitle { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.5px; }
.source-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #425b39; border-radius: 20px; padding: 6px 9px; color: #add994; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.source-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.source-badge.saved { color: #e6cf86; border-color: #655a37; }
.panel-section { padding: 18px 22px; border-top: 1px solid #ffffff0d; }
.section-label { margin: 0 0 12px; font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: #989e86; }
#controls button { min-height: 43px; width: 100%; border: 1px solid #484d3a; border-radius: 9px; background: #303426; color: #e4e6d7; padding: 11px 12px; text-align: center; transition: background .15s, border-color .15s; font-size: 12px; }
#controls button:hover { background: #414732; border-color: #737956; }
#controls button:disabled { opacity: .5; cursor: wait; }
#controls #sourceToggle { background: #d9d28c; color: #232718; border-color: #e5dda1; font-weight: 600; }
#controls #sourceToggle:hover { background: #e8e1a5; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 9px; }
#toggleTitle, .sound-toggle { margin-top: 9px; }
.restart-setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12px; color: #cfd3c0; }
.restart-setting select { flex-shrink: 0; max-width: 58%; background: #1c1f17; border: 1px solid #454938; border-radius: 6px; color: inherit; padding: 6px 7px; font: inherit; }
#feedStatus { margin: 12px 0 0; color: #a4aa94; font-size: 11px; line-height: 1.6; }
#feedStatus.error { color: #edbd7c; }
.panel-note { margin: 0; border-top: 1px solid #ffffff0d; padding: 15px 22px; color: #939a83; font-size: 11px; line-height: 1.6; }
.ads-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #e4e6d7; margin-bottom: 12px; }
.ads-toggle input { width: 16px; height: 16px; flex-shrink: 0; }
.ads-timing { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #cfd3c0; margin-bottom: 12px; }
.ads-timing input { width: 52px; margin: 0 6px; background: #1c1f17; border: 1px solid #454938; border-radius: 6px; color: inherit; padding: 5px 6px; font: inherit; }
.ads-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.ads-list li { display: flex; align-items: center; gap: 8px; background: #262a1f; border: 1px solid #3c4030; border-radius: 8px; padding: 6px 8px; }
.ads-list img { width: 42px; height: 30px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: #111; }
.ads-list span { flex: 1; min-width: 0; font-size: 11px; color: #cfd3c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-list button { width: auto; min-height: auto; padding: 5px 9px; font-size: 11px; flex-shrink: 0; }
/* Chromecast section (only shown inside the installable Electron app, which
   exposes window.luppoloCast — see plugins/beers/cast-panel.js). */
.cast-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow-x: hidden; overflow-y: auto; }
#controls .cast-device { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: #262a1f; border: 1px solid #3c4030; border-radius: 8px; padding: 8px 10px; min-height: 0; }
.cast-device:hover { border-color: #737956; background: #2c3125; }
.cast-device.active { border-color: #add994; }
.cast-info { flex: 1 1 auto; min-width: 0; }
.cast-name, .cast-meta { display: block; overflow-wrap: anywhere; }
.cast-name { font-size: 12px; font-weight: 600; color: #e4e6d7; }
.cast-meta { font-size: 10px; color: #9aa08a; margin-top: 2px; }
.cast-state { flex-shrink: 0; font-size: 10px; font-weight: 700; color: #add994; white-space: nowrap; }
.cast-device.active .cast-state { color: #e6cf86; }
#castAllButton { background: #d9d28c; color: #232718; border-color: #e5dda1; font-weight: 600; margin-bottom: 12px; }
#castAllButton:hover { background: #e8e1a5; }
.cast-manual { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 9px; }
.cast-manual input { min-width: 0; background: #1c1f17; border: 1px solid #454938; border-radius: 8px; color: #e4e6d7; padding: 9px 10px; font: inherit; font-size: 12px; }
.cast-manual button { width: auto; padding: 9px 12px; }
#adOverlay { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#adOverlay[hidden] { display: none; }
#adOverlay img { max-width: 100%; max-height: 100%; object-fit: contain; }
body.controls-hidden #menuToggle { opacity: 0; pointer-events: none; }
body.cursor-hidden, body.cursor-hidden button { cursor: none; }
button:focus-visible { outline: 2px solid #e8df70; outline-offset: 3px; }
@media (max-width: 600px) { #menuToggle { right: 16px; top: 16px; } #controls { right: 16px; top: 74px; } #boardTitle { padding-right: 48px; } }
@media (prefers-reduced-motion: reduce) { #controls, #menuToggle, #menuToggle svg { transition: none; } }

.location { overflow: hidden; }
.location span { display: block; width: max-content; }
.scrolling { animation: board-scroll var(--scroll-duration) linear 6s infinite alternate; }
@keyframes board-scroll {
  0%, 20% { transform: translateX(0); }
  80%, 100% { transform: translateX(var(--travel)); }
}
@media (prefers-reduced-motion: reduce) {
  .scrolling { animation-duration: 30s; }
}

.tap-tile { width: 88px; height: 52px; position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(#232632 48%, #070908 49%, #070908 54%, #1c1f29 55%); border-radius: 2px; }
.tap-badge { border: 0; padding: 0; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: #ff951f; color: #151510; font: 700 33px/46px Arial, sans-serif; text-align: center; letter-spacing: -1px; }
.tap-tile::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #080a0938; pointer-events: none; }
.row-lights { width: 90px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.lamp { border: 0; padding: 0; background-color: transparent; width: 18px; height: 18px; flex: 0 0 18px; background-repeat: no-repeat; }
.lamp.green { background-image: url('../../img/lights_green.png'); }
.lamp.red { background-image: url('../../img/lights_red.png'); }
.lamp.on { background-position: -18px 0; }

@keyframes lamp-blink { 0%, 49% { background-position: -18px 0; } 50%, 100% { background-position: 0 0; } }
.row-lights.alternating .green { animation: lamp-blink 1.2s steps(1, end) infinite; }
.row-lights.alternating .red { animation: lamp-blink-inverse 1.2s steps(1, end) infinite; }
@keyframes lamp-blink-inverse { 0%, 49% { background-position: 0 0; } 50%, 100% { background-position: -18px 0; } }
