/* LIVE-specific elements. Colors, shell, heroes, buttons and motion come from app.css. */
.htq-live { --blueColorDark: #08162b; --blueColorSlightDarkLighter: #0c223f; --blueColorLight: #439eed; --BorderBlueColorLight: #86adf239; --orangeColorLight: #ee8424; --white: #f5f8ff; }
.live-brand { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px; border-bottom: 1px solid #86adf22a; }
.live-brand img { width: 64px; height: 64px; }
.live-brand span { color: #a9c9ee; font-size: 11px; letter-spacing: .24em; }
.live-brand strong { display: block; margin-top: 5px; color: #f5f8ff; font-size: 25px; letter-spacing: -.035em; }
.live-heading-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-connection { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 500; }
.live-connection::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9db9dc; flex-shrink: 0; }
.live-connection[data-state="connected"]::before { background: #93dab8; box-shadow: 0 0 9px #93dab83a; }
.live-connection[data-state="offline"]::before { background: #ffb367; }
.app-event-label.live-connection-label { font-size: 11px; font-weight: 650; letter-spacing: .08em; color: #9db9dc; }
.htq-live .live-logout { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #b8cbe3; font-size: 12px; }
.live-logout svg { width: 17px; height: 17px; }
.htq-live .live-logout:hover { color: #ffb367; }
#main { display: grid; gap: 20px; min-width: 0; }
.game-card { min-width: 0; animation: app-modal-in .3s ease-out; }
.game-description { min-width: 0; }
.htq-app .game-title { font-size: clamp(25px, 4.4vw, 34px); line-height: 1.17; font-weight: 750; }
.game-type { margin-bottom: 9px; }
.game-subtitle { white-space: pre-line; overflow-wrap: anywhere; }
.game-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.game-actions { margin-top: 26px; }
.htq-app .game-toggle.rissen { background: linear-gradient(125deg,#163c32,#122d31); border-color: #519b7b88; color: #b7efd5 !important; box-shadow: 0 5px 22px #519b7b15; animation: none; }
.game-toggle.rissen::after, .game-toggle:disabled::after { content: none; }
.game-toggle:disabled { transform: none !important; animation: none; }
.htq-app .live-vote-hint { margin: 12px 0 0; font-size: 12px; text-align: center; }
.live-waiting p { margin-bottom: 0; }
.live-waiting-indicator { display: inline-flex; align-items: center; gap: 6px; padding-top: 24px; }
.live-waiting-indicator i { width: 5px; height: 5px; border-radius: 50%; background: #9db9dc; animation: live-wait 1.8s ease-in-out infinite; }
.live-waiting-indicator i:nth-child(2) { animation-delay: .2s; }
.live-waiting-indicator i:nth-child(3) { animation-delay: .4s; }
@keyframes live-wait { 50% { opacity: .3; transform: translateY(-3px); } }
.live-links { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 24px; }
.htq-live #main[hidden] + .live-links { margin-top: 0; }
.live-links > div { min-width: 0; }
.live-links .btn { width: 100%; min-height: 62px; justify-content: space-between; padding: 16px 18px; font-size: 14px; text-align: left; }
.live-links .btn > span { display: flex; align-items: center; gap: 13px; }
.live-links .btn svg { flex-shrink: 0; width: 21px; height: 21px; }
.live-links .btn > svg { width: 17px; height: 17px; opacity: .6; }
#container-fb { grid-column: 1 / -1; order: -1; }
#container-fb .btn { min-height: 84px; padding: 23px 20px; font-size: 16px; border-color: #8aacd76b; background: linear-gradient(115deg,#153352,#0d2238); }
#container-fb .btn > span > svg { width: 27px; height: 27px; color: #ffc18a; }
#container-fb .btn span { display: flex; align-items: center; gap: 12px; }
.live-guest .app-primary { margin-top: 24px; }
.live-guest p { margin-bottom: 0; }
.notification { position: fixed; z-index: 200; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%,12px); width: max-content; max-width: min(520px,calc(100% - 36px)); padding: 13px 20px; border: 1px solid #87bded66; border-radius: 16px; background: #143655f5; box-shadow: 0 8px 30px #0005; font-size: 12px; text-align: center; line-height: 1.6; opacity: 0; visibility: hidden; transition: transform .25s,opacity .25s,visibility .25s; pointer-events: none; }
.notification.show { opacity: 1; visibility: visible; transform: translate(-50%,0); }
.notification.error { color: #ffcbc8; background: #422324f5; border-color: #c5787866; }
.notification.success { color: #b7efd5; background: #163c32f5; border-color: #519b7b66; }
.notification.warning { color: #ffddb1; background: #3a281af5; border-color: #d9954c70; }
/* The same seal, ring and confetti used by the App's confirmation screen. */
#draw-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: #000a; backdrop-filter: blur(12px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s,visibility .3s; }
#draw-overlay.draw-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.draw-content.app-celebration { width: min(560px,100%); max-height: calc(100dvh - 36px); overflow-y: auto; margin: 0; padding: 45px 25px 32px; border: 1px solid #84b5f07d; border-radius: 22px; background: linear-gradient(140deg,#12355b,#061428 85%); box-shadow: 0 25px 90px #0009; }
.draw-content .app-icon-button { position: absolute; right: 14px; top: 14px; z-index: 1; }
.draw-content .app-eyebrow { color: #ffb367; }
.draw-content p { margin: 18px 0 24px; }
.draw-next-time .app-success-seal { background: linear-gradient(145deg,#1d4d78,#125292); border-color: #84b5f0; box-shadow: 0 0 50px #12529255; }
.draw-next-time .app-success-seal path { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; animation: none !important; }
/* The same shell expands only for staff work areas. */
.htq-app.live-staff .team-public-shell { width: min(1160px,calc(100% - 28px)); }
.live-staff .team-public-header { max-height: 250px; object-fit: cover; }
.live-staff #main { grid-template-columns: repeat(2,minmax(0,1fr)); }
.live-staff .game-card { position: relative; padding: 27px 24px 24px; }
.live-staff .game-content { display: flex; flex-direction: column; height: 100%; }
.live-staff .game-description { flex: 1; padding-top: 23px; }
.live-staff .game-title { font-size: 23px; }
.live-staff .game-subtitle { font-size: 13px; margin-bottom: 0; }
.game-status { position: absolute; top: 22px; left: 24px; display: flex; align-items: center; gap: 7px; color: #97b0ce; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.game-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #97b0ce; }
.game-status::after { content: 'Ausgeblendet'; }
.is-open .game-status::before { background: #93dab8; }
.is-open .game-status::after { content: 'Meldung freigegeben'; color: #b7efd5; }
.is-locked .game-status::before { background: #ffb367; }
.is-locked .game-status::after { content: 'Meldung geschlossen'; color: #ffb367; }
.is-waiting .game-status::after { content: 'Wartescreen aktiv'; }
.voting-lock { display: none; align-items: center; justify-content: center; gap: 9px; width: 100%; }
.live-staff .game-actions { display: grid; gap: 10px; }
.is-open .voting-lock,.is-locked .voting-lock { display: flex; }
.voting-lock svg { width: 20px; height: 20px; }
.voting-lock .icon-unlock,.is-open .voting-lock .icon-lock { display: none; }
.is-open .voting-lock .icon-unlock { display: inline-flex; }
.is-locked .voting-lock .icon-lock { display: inline-flex; }
#downer-navBorder { display: none; }
#teamSelectionContainer { grid-column: 1/-1; min-width: 0; padding: 24px; border: 1px solid #86adf239; border-radius: 18px; background: linear-gradient(120deg,#081d39ed,#08152ddb); }
#teamSelectionContainer:empty { display: none; }
.voting-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.voting-info h2 { font-size: 21px; }
.voting-info p { margin: 8px 0 0; font-size: 12px; }
#countTeamsCurrentVoting,#clientCount { color: #ffb367; font-weight: 700; font-variant-numeric: tabular-nums; }
.client-count { flex-shrink: 0; padding: 8px 10px; border: 1px solid #86adf239; border-radius: 8px; background: #12529233; color: #b8cbe3; font-size: 11px; }
.voting-divider { height: 1px; margin: 22px 0; background: #86adf22a; }
.voting-content { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; }
.teams-label { grid-column: 1/-1; margin: 0; font-size: 12px; }
.teams-display { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
.team-box { min-width: 0; min-height: 44px; display: grid; place-items: center; border: 1px solid #86adf24a; border-radius: 10px; color: #b8cbe3; background: #08172cc9; font-weight: 650; cursor: pointer; transition: background .2s,border-color .2s,transform .2s; }
.team-box:hover { background: #183652; }
.team-box.active { color: #ffc18a; background: #ee842417; border-color: #ee842480; }
#teams-loser,.teams-draw,.htq-live .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 18px; border: 1px solid #ffb36c77; border-radius: 11px; background: linear-gradient(125deg,#ee8424,#db7020); color: #0b1727; font-weight: 800; box-shadow: 0 5px 22px #ee842421; transition: transform .18s,filter .18s; }
#teams-loser:hover,.teams-draw:hover,.htq-live .button:hover { transform: translateY(-2px); filter: brightness(1.07); }
#drawn-teams { margin-top: 26px; }
.drawn-teams-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.drawn-teams-header h2 { font-size: 21px; }
#drawn-teams-count { color: #b8cbe3; font-size: 11px; }
#drawn-teams-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.drawn-team-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 17px; border: 1px solid #86adf23d; border-radius: 16px; background: linear-gradient(120deg,#081d39ed,#08152ddd); animation: app-modal-in .3s ease-out; }
.drawn-team-number { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border: 1px solid #ee842477; border-radius: 10px; color: #ffc18a; background: #ee842417; font-weight: 700; }
.drawn-team-content { min-width: 0; }
.drawn-team-id { display: block; margin-bottom: 5px; font-size: 9px; color: #a9c9ee; letter-spacing: .1em; }
.drawn-team-content h3 { font-size: 14px; font-weight: 650; }
.drawn-groups-overview { margin-bottom: 14px; color: #b8cbe3; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.drawn-groups-overview strong { color: #ffc18a; }
#publish-draw-btn { margin-top: 18px; }
.live-staff-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.live-staff-links a { font-size: 12px; }
/* Credentials keep the existing POST/session flow. */
.htq-app.live-login .team-public-shell { width: min(580px,calc(100% - 28px)); }
.login-form { display: flex; flex-direction: column; gap: 11px; }
.login-form label { color: #c2d8f2; font-size: 13px; font-weight: 650; margin-top: 7px; }
.login-form input { width: 100%; min-height: 48px; border: 1px solid #86adf24a; border-radius: 12px; padding: 12px 15px; color: #f5f8ff; background: #08172cc9; font-size: 16px; }
.login-form input:focus { border-color: #9dd4ff; }
.login-form .btn { width: 100%; margin-top: 15px; }
.login-error { margin: 0 0 22px; padding: 14px 16px; border: 1px solid #c5787866; border-radius: 12px; background: #422324; color: #ffcbc8 !important; font-size: 13px; }
.htq-live .login-back { display: inline-flex; margin-top: 24px; font-size: 12px; color: #b8cbe3; }
/* Preserve the existing 8 × 8 numbering and stage position. */
#app { min-width: 0; overflow-x: auto; padding: 24px; border: 1px solid #86adf239; border-radius: 20px; background: linear-gradient(125deg,#102d50ef,#08152de8); }
.seating-wrapper { display: flex; align-items: stretch; gap: 18px; width: 100%; max-width: 760px; min-width: 0; margin: 0 auto; }
.seating-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); grid-template-rows: repeat(8,minmax(32px,1fr)); gap: 10px; flex: 1; aspect-ratio: 1/1; }
.table-box { display: grid; place-items: center; min-width: 0; border: 1px solid #86adf24a; border-radius: 10px; background: #08172cc9; color: #c9ddf3; font-size: clamp(11px,1.8vw,18px); font-weight: 650; transition: background .25s,border-color .25s,box-shadow .25s; }
.table-box.highlighted { border-color: #ffb36c; background: linear-gradient(125deg,#ee8424,#db7020); color: #0b1727; box-shadow: 0 0 18px #ee84242b; }
.stage-box { display: grid; place-items: center; width: 42px; border: 1px solid #86adf24a; border-radius: 12px; background: #12529244; color: #a9c9ee; writing-mode: vertical-rl; font-size: 11px; font-weight: 750; letter-spacing: .2em; }
.live-seating-legend { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; font-size: 11px; color: #b8cbe3; }
.live-seating-legend span { display: inline-flex; align-items: center; gap: 7px; }
.live-seating-legend i { width: 10px; height: 10px; border: 1px solid #86adf24a; border-radius: 3px; background: #08172c; }
.live-seating-legend .is-selected { background: #ee8424; border-color: #ffb36c; }
@media (max-width: 700px) {
    .live-staff #main { grid-template-columns: minmax(0,1fr); }
    #drawn-teams-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .voting-content { grid-template-columns: minmax(0,1fr); }
    .voting-header { align-items: flex-start; flex-direction: column; gap: 12px; }
    #teams-loser { width: 100%; }
}
@media (max-width: 600px) {
    .htq-app.live-staff .team-public-shell,.htq-app.live-login .team-public-shell { width: calc(100% - 20px); }
    .live-heading-line { align-items: flex-start; flex-direction: column; gap: 8px; }
    .app-event-label { font-size: 10px; }
    .live-links { gap: 10px; }
    #teamSelectionContainer { padding: 18px; }
    .teams-display { gap: 6px; }
    .live-staff .game-card { padding: 25px 22px; }
    #app { padding: 12px; }
    .seating-wrapper { gap: 8px; }
    .seating-grid { gap: 4px; grid-template-rows: repeat(8,minmax(24px,1fr)); }
    .table-box { border-radius: 6px; }
    .stage-box { width: 20px; flex-shrink: 0; font-size: 9px; }
    .draw-content.app-celebration { padding: 45px 20px 28px; }
}
@media (max-width: 400px) {
    #drawn-teams-grid { grid-template-columns: minmax(0,1fr); }
    .live-links { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .htq-live *, .htq-live *::before, .htq-live *::after { animation: none !important; transition: none !important; }
}

/* A confirmed registration is a card state; withdrawal stays a separate action. */
@property --live-border-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
[data-live-page="team"] .game-card { transition: background .45s, border-color .45s, box-shadow .45s; }
[data-live-page="team"] .game-card.is-registered { border-color: #86d3b65c; background: radial-gradient(ellipse at 100% 0,#4cb39e22,transparent 65%),linear-gradient(125deg,#103435,#091e30 80%); box-shadow: 0 16px 44px #0002,0 0 32px #72dab00d; }
.is-registered .app-hero-icon { color: #b9f5d8; border-color: #82d7b781; background: linear-gradient(140deg,#5dc69738,#1b4b49); box-shadow: 0 0 28px #68d4a521; animation: live-confirm .65s cubic-bezier(.2,.9,.3,1.2) both; }
.is-registered .app-hero-icon path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: live-check .5s ease .2s forwards; }
.is-registered .game-type { color: #a4e7cd; }
.htq-app .live-registration-status { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; padding: 15px 16px; border: 1px solid #8ed9ba35; border-radius: 12px; background: #7bcfa90b; color: #c3f5de; font-size: 15px; font-weight: 650; line-height: 1.5; animation: live-status-in .4s ease both; }
.live-registration-status > span { flex: 0 0 6px; height: 6px; border-radius: 50%; background: #a9ebce; box-shadow: 0 0 12px #a9ebce88; }
.htq-app .live-withdraw { display: flex; width: 100%; justify-content: center; border: 1px solid #9cbac029; background: #06132140; color: #9eafb9; font-size: 12px; font-weight: 500; box-shadow: none; transition: background .2s,color .2s,border-color .2s; }
.htq-app .live-withdraw:hover:not(:disabled) { color: #d2e2e7; background: #a6c8d00c; border-color: #9cbac05c; }
.htq-app .live-withdraw:disabled { opacity: .5; cursor: not-allowed; }
.live-registration-effects { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; }
.live-registration-border { position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; background: conic-gradient(from var(--live-border-angle),#74d7b214, #9bedd352, #c3fbf2 13%, #70b9ff99 19%, #70b9ff14 29%, #74d7b214 55%, #b9f2d591 66%, #eeb58188 72%, #74d7b214 83%); -webkit-mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); mask-composite: exclude; animation: live-border-turn 7s linear infinite; }
.live-registration-effects > i { position: absolute; left: 0; top: 0; width: 4px; height: 4px; border-radius: 50%; background: #d8fff1; box-shadow: 0 0 5px #d8fff1,0 0 12px #8be5ff; offset-path: inset(2px round 18px); offset-distance: 0%; animation: live-border-particle 7s linear infinite; }
.live-registration-effects > i:nth-of-type(2) { width: 3px; height: 3px; background: #ffd7b2; animation-delay: -3.5s; box-shadow: 0 0 6px #ffd7b2; }
@keyframes live-confirm { 0% { opacity: .4; transform: scale(.75) rotate(-9deg); } 65% { transform: scale(1.08) rotate(3deg); } 100% { opacity: 1; transform: none; } }
@keyframes live-check { to { stroke-dashoffset: 0; } }
@keyframes live-status-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes live-border-turn { to { --live-border-angle: 360deg; } }
@keyframes live-border-particle { to { offset-distance: 100%; } }
@media (max-width: 600px) { .app-event-label.live-connection-label { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) {
    .is-registered .app-hero-icon path { stroke-dashoffset: 0; }
    .live-registration-effects > i { display: none; }
}
