* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:            #060a12;
    --bg-surface:    #0c1220;
    --bg-row-hover:  #101828;
    --green:         #00e676;
    --green-dim:     rgba(0, 230, 118, 0.12);
    --green-glow:    rgba(0, 230, 118, 0.3);
    --amber:         #ffab40;
    --text:          #dce2ea;
    --text-sec:      #6b7b8e;
    --text-dim:      #3a4d62;
    --border:        #151f33;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    min-height: 100vh;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ─── HEADER ─── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.header-logo {
    height: 48px;
    width: auto;
    display: block;
}

.conn-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s, box-shadow 0.3s;
}
.conn-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green-glow);
}

/* ─── SECTION LABELS ─── */
.section-header {
    position: relative;
    text-align: center;
    margin-bottom: 10px;
}

.section-header .section-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
}

.section-title {
    font-family: 'Sora', sans-serif;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text);
}
.section-title span { color: var(--green); }

.section-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 10px;
}


.active-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s, background 0.4s, opacity 0.4s;
    margin-bottom: 40px;
}

.active-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--text-dim);
    transition: background 0.4s, box-shadow 0.4s;
}

.active-card.live::before {
    background: var(--green);
    box-shadow: 0 0 20px var(--green-glow);
}
.active-card.live {
    border-color: rgba(0, 230, 118, 0.28);
    background: linear-gradient(180deg, rgba(0,230,118,0.07) 0%, var(--bg-surface) 50%);
}

.active-card.idle {
    opacity: 0.38;
    border-color: var(--border);
    background: var(--bg-surface);
}
.active-card.idle::before {
    background: var(--text-dim);
}


.card-layout {
    display: flex;
    gap: 36px;
    align-items: stretch;
}

.card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-player {
    flex-shrink: 0;
    width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    justify-content: center;
    border-left: 1px solid var(--border);
    padding-left: 36px;
}

/* ─── INFO SIDE ─── */
.no-active {
    color: var(--text-dim);
    font-size: 14px;
    font-style: italic;
}

.active-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 10px;
}

.active-top-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tx-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green-dim);
    border: 1px solid rgba(0,230,118,0.3);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 2px;
}

.tx-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 1.4s infinite;
}

.idle-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(58, 77, 98, 0.25);
    border: 1px solid rgba(58, 77, 98, 0.4);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 1.5px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.2; }
}

.active-callsign {
    font-family: 'Sora', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}
.active-callsign a {
    color: var(--text);
    text-decoration: none;
}
.active-callsign a:hover { color: var(--green); }

.active-flag {
    font-size: 56px;
    line-height: 1;
}

.elapsed-timer {
    font-size: 36px;
    font-weight: 300;
    color: var(--green);
    letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
    margin-bottom: 6px;
}
.elapsed-timer.frozen {
    color: var(--text-dim);
    text-shadow: none;
}

.active-name {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-sec);
    margin-bottom: 22px;
    letter-spacing: 0.5px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px 20px;
}

.detail-item { display: flex; flex-direction: column; gap: 4px; }

.detail-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 500;
}

.detail-value {
    font-size: 13px;
    color: var(--text);
}
.detail-value a {
    color: var(--amber);
    text-decoration: none;
}
.detail-value a:hover { text-decoration: underline; }

/* ─── PLAYER SIDE ─── */
.vu-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.player-knobs {
    display: flex;
    align-items: center;
    gap: 32px;
}

.player-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.player-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s, box-shadow 0.3s;
}
.player-led.on {
    background: var(--green);
    box-shadow: 0 0 8px var(--green-glow);
}
.player-status-txt {
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color 0.3s;
}
.player-status-txt.on { color: var(--green); }

.knob-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.knob-label {
    font-size: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.knob {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, #1e2736, #0d1018 70%);
    border: 1px solid #1e2a3a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}
.knob::after {
    content: '';
    width: 2px;
    height: 14px;
    background: var(--text-dim);
    border-radius: 1px;
    position: absolute;
    top: 5px;
    left: 50%;
    transform-origin: 50% 100%;
    transform: translateX(-50%) rotate(var(--angle, 0deg));
    transition: background 0.3s;
}

#powerKnob { cursor: pointer; }
#powerKnob::after { --angle: -40deg; background: var(--text-dim); }
#powerKnob.on::after { --angle: 40deg; background: var(--green); }
#powerKnob.on {
    border-color: rgba(0, 230, 118, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 14px rgba(0, 230, 118, 0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}

#volKnob { cursor: ns-resize; }

/* ─── CONTACTS TABLE ─── */
.contacts-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead { border-bottom: 1px solid var(--border); }

th {
    text-align: left;
    padding: 10px 14px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
tbody tr:hover { background: var(--bg-row-hover); }

tbody tr.flash { animation: rowFlash 2s ease forwards; }
@keyframes rowFlash {
    0%   { background: rgba(0, 230, 118, 0.12); }
    100% { background: transparent; }
}

td {
    padding: 9px 14px;
    color: var(--text-sec);
    white-space: nowrap;
}

.td-call a { color: var(--text); text-decoration: none; font-weight: 500; }
.td-call a:hover { color: var(--green); }

.td-dmrid a { color: var(--amber); text-decoration: none; font-size: 11px; }
.td-dmrid a:hover { text-decoration: underline; }

.td-name { color: var(--text); }
.td-dur  { color: var(--green); font-variant-numeric: tabular-nums; font-weight: 500; }
.td-time { color: var(--text-dim); font-size: 11px; }

.empty-row td {
    color: var(--text-dim);
    font-style: italic;
    padding: 20px 14px;
}

/* ─── FOOTER ─── */
footer {
     margin-top: auto;   
    padding-top: 5px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-copy {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-dim);
}