* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Noto Sans KR", sans-serif;
    color: #111;
}

a {
    color: inherit;
    text-decoration: none;
}

.broadcast-body {
    min-height: 100vh;
    padding-bottom: 54px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255, 47, 47, .45), transparent 32rem),
        linear-gradient(135deg, #050505 0%, #210303 52%, #000 100%);
}

.admin-body {
    min-height: 100vh;
    background: #f5f6f8;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 28px;
    color: #fff;
    background: #b40000;
    border-bottom: 3px solid #ffcc00;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #b40000;
    background: #ffcc00;
    font-weight: 900;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.topbar nav a {
    padding: 8px 10px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
}

.broadcast-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.live-stage {
    position: relative;
    min-height: 440px;
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(0, 0, 0, .72);
    border: 4px solid #d10000;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.live-badge {
    position: absolute;
    left: 26px;
    top: 24px;
    padding: 8px 14px;
    background: #df0000;
    border: 2px solid #ffcc00;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .06em;
}

.phone {
    position: absolute;
    right: 26px;
    top: 20px;
    margin: 0;
    color: #ffdd57;
    font-size: 24px;
    font-weight: 900;
}

.hero-ad {
    max-width: 980px;
    margin: 36px auto 0;
    text-align: center;
}

.section-label {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 12px;
    color: #111;
    background: #ffcc00;
    font-weight: 800;
}

.hero-ad h1 {
    margin: 0 0 22px;
    color: #fff;
    font-size: clamp(34px, 5vw, 72px);
    line-height: 1.12;
    word-break: keep-all;
}

.hero-content {
    color: #fff6e0;
    font-size: clamp(22px, 2.4vw, 36px);
    font-weight: 700;
    line-height: 1.45;
    word-break: keep-all;
}

.meta {
    margin-top: 22px;
    color: #d7d7d7;
}

.ad-section {
    margin-top: 28px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    color: #ffcc00;
    font-size: 28px;
}

.section-head span {
    color: #ddd;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ad-card,
.blank {
    min-height: 190px;
    padding: 20px;
    background: rgba(255, 255, 255, .95);
    color: #151515;
    border-top: 6px solid #b40000;
}

.ad-card.pinned {
    border-top-color: #ffcc00;
}

.pin {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 8px;
    color: #b40000;
    background: #ffec8a;
    font-weight: 800;
}

.ad-card h3 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.25;
}

.ad-card p {
    margin: 0 0 18px;
    line-height: 1.55;
    color: #333;
}

.ad-card small {
    color: #666;
}

.blank {
    grid-column: 1 / -1;
    min-height: auto;
    color: #555;
}

.ticker {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    white-space: nowrap;
    padding: 13px 0;
    color: #111;
    background: #ffcc00;
    font-weight: 900;
}

.ticker span {
    display: inline-block;
    min-width: 100%;
    padding-left: 100%;
    animation: ticker 22s linear infinite;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.setup-box,
.form-wrap,
.admin-wrap {
    width: min(1100px, calc(100% - 32px));
    margin: 34px auto;
}

.setup-box,
.form-panel,
.table-box {
    background: #fff;
    border: 1px solid #dedede;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.setup-box,
.form-panel {
    padding: 28px;
}

.form-wrap {
    width: min(560px, calc(100% - 32px));
}

.form-wrap.wide {
    width: min(820px, calc(100% - 32px));
}

.setup-box h1,
.form-panel h1,
.page-title h1 {
    margin: 0 0 10px;
}

.muted,
.page-title p {
    color: #666;
}

.stack-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    font: inherit;
    border: 1px solid #cfcfcf;
    background: #fff;
}

textarea {
    resize: vertical;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #bcbcbc;
    background: #fff;
    color: #111;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.btn.primary,
button.primary {
    color: #fff;
    background: #b40000;
    border-color: #b40000;
}

.button-row,
.admin-save {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.admin-save {
    justify-content: flex-end;
    padding: 16px;
    border-top: 1px solid #e5e5e5;
}

.notice {
    margin: 16px 0;
    padding: 14px 16px;
    border-left: 5px solid;
}

.notice.success {
    background: #edf8ef;
    border-color: #1d8d3f;
}

.notice.danger {
    background: #fff1f1;
    border-color: #c40000;
}

.update-log {
    margin-top: 18px;
}

.update-log ul {
    margin: 12px 0 0;
    padding-left: 20px;
    line-height: 1.8;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.table-box {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #171717;
    color: #fff;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actions a,
.actions button {
    min-height: 34px;
    padding: 6px 9px;
}

.actions form {
    display: inline;
}

.red {
    display: inline-block;
    margin-left: 6px;
    color: #c40000;
}

.empty-cell {
    text-align: center;
    color: #777;
}

@media (max-width: 820px) {
    .topbar,
    .page-title,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .live-stage {
        min-height: 380px;
        padding: 76px 18px 24px;
    }

    .phone {
        position: static;
        margin: 0 0 12px;
        font-size: 20px;
        text-align: center;
    }

    .live-badge {
        left: 18px;
        top: 18px;
    }

    .ad-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        display: grid;
    }
}

/* 24-hour vertical broadcast screen */
.live-stage.vertical-stage {
    width: min(430px, 100%);
    aspect-ratio: 9 / 16;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-rows: auto auto 1fr 1fr;
    background: rgba(0, 0, 0, .78);
}

.stage-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    color: #111;
    background: #ffcc00;
    font-size: 13px;
    font-weight: 900;
}

.stage-status span {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
}

.stage-status strong {
    font-size: 18px;
}

.screen-header {
    min-height: 76px;
    padding: 12px 14px;
    background: linear-gradient(90deg, #8d0000, #d10000);
    border-bottom: 2px solid #ffcc00;
}

.screen-title {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
}

.vertical-stage .live-badge {
    position: static;
    display: inline-block;
    font-size: 16px;
}

.vertical-stage .phone {
    position: static;
    margin: 8px 0 0;
    font-size: 22px;
}

.broadcast-block {
    position: relative;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
}

.admin-broadcast-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, .34), rgba(0, 0, 0, .68)), #240000;
    border-bottom: 3px solid #ffcc00;
}

.admin-broadcast-block h1 {
    margin: 10px 0 12px;
    color: #fff;
    font-size: clamp(28px, 8vw, 44px);
    line-height: 1.15;
    word-break: keep-all;
}

.admin-broadcast-block p {
    margin: 0;
    color: #fff6e0;
    font-size: clamp(18px, 5vw, 25px);
    font-weight: 800;
    line-height: 1.45;
    white-space: pre-line;
    word-break: keep-all;
}

.admin-broadcast-block small {
    margin-top: 12px;
    color: #ddd;
}

.current-read-window {
    width: 100%;
    margin: 20px 0 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, .42);
    border-top: 3px solid #ffcc00;
    border-bottom: 3px solid #ffcc00;
}

.current-job-panel {
    width: 100%;
    margin: 18px 0 12px;
    padding: 16px;
    background: rgba(0, 0, 0, .38);
    border-top: 3px solid #ffcc00;
    border-bottom: 3px solid #ffcc00;
}

.current-job-panel h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(26px, 6vw, 42px);
    line-height: 1.16;
    word-break: keep-all;
}

.current-job-panel p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    overflow: hidden;
    color: #fff6e0;
    font-size: clamp(16px, 4.2vw, 24px);
    font-weight: 800;
    line-height: 1.35;
    word-break: keep-all;
}

.current-read-window span {
    display: inline-block;
    min-width: 100%;
    padding: 22px 0 22px 100%;
    color: #fff6e0;
    font-size: clamp(24px, 6vw, 42px);
    font-weight: 900;
    line-height: 1.25;
    white-space: nowrap;
    animation: readLineMove 22s linear infinite;
}

@keyframes readLineMove {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.block-label {
    display: inline-block;
    align-self: center;
    padding: 8px 12px;
    color: #fff;
    background: #d10000;
    font-weight: 800;
}

.block-label.yellow {
    color: #111;
    background: #ffcc00;
}

.live-caption-block {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    background: #050505;
}

.caption-lines {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    min-height: 0;
}

.caption-line {
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #151515;
    border-left: 5px solid #d10000;
}

.caption-line span {
    display: inline-block;
    min-width: 100%;
    padding-left: 100%;
    color: #fff;
    font-size: clamp(18px, 5vw, 25px);
    font-weight: 900;
    white-space: nowrap;
    animation: captionMove 18s linear infinite;
}

.caption-line.line-2 span {
    animation-duration: 22s;
}

.caption-line.line-3 span {
    animation-duration: 26s;
}

@keyframes captionMove {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

.voice-control {
    width: 100%;
    color: #111;
    background: #ffcc00;
    border: 0;
    font-size: 18px;
    font-weight: 900;
}

.voice-control.has-new {
    background: #fff;
    color: #b40000;
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.obs-body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #fff;
    background: #000;
}

.obs-capture-shell {
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
}

.obs-stage.live-stage.vertical-stage {
    width: min(100vw, calc(100vh * 9 / 16));
    height: min(100vh, calc(100vw * 16 / 9));
    aspect-ratio: 9 / 16;
    border: 0;
    box-shadow: none;
}

.obs-stage .stage-status {
    font-size: clamp(18px, 2vh, 30px);
}

.obs-stage .stage-status span {
    padding: clamp(12px, 1.5vh, 24px) clamp(18px, 2vw, 36px);
}

.obs-stage .stage-status strong {
    font-size: clamp(28px, 3.2vh, 54px);
}

.obs-stage .screen-header {
    min-height: 0;
    padding: clamp(20px, 2.4vh, 42px);
}

.obs-stage .screen-title {
    font-size: clamp(46px, 5.5vh, 96px);
}

.obs-stage .live-badge {
    font-size: clamp(26px, 3vh, 52px);
}

.obs-stage .phone {
    margin-top: clamp(14px, 1.8vh, 30px);
    font-size: clamp(34px, 4vh, 72px);
}

.obs-stage .broadcast-block {
    padding: clamp(28px, 3.4vh, 60px);
}

.obs-stage .block-label {
    padding: clamp(12px, 1.4vh, 24px) clamp(18px, 2vw, 36px);
    font-size: clamp(24px, 2.8vh, 48px);
}

.obs-stage .admin-broadcast-block h1 {
    font-size: clamp(52px, 6.4vh, 108px);
}

.obs-stage .admin-broadcast-block p {
    font-size: clamp(34px, 4vh, 68px);
}

.obs-stage .admin-broadcast-block small {
    font-size: clamp(18px, 2vh, 34px);
}

.obs-stage .current-read-window {
    margin: clamp(28px, 3.4vh, 62px) 0 clamp(20px, 2.5vh, 42px);
    border-top-width: clamp(4px, .55vh, 10px);
    border-bottom-width: clamp(4px, .55vh, 10px);
}

.obs-stage .current-read-window span {
    padding-top: clamp(34px, 4vh, 70px);
    padding-bottom: clamp(34px, 4vh, 70px);
    font-size: clamp(54px, 6.4vh, 108px);
    animation-duration: 26s;
}

.obs-stage .current-job-panel {
    margin: clamp(24px, 3vh, 54px) 0 clamp(16px, 2vh, 36px);
    padding: clamp(24px, 3vh, 54px);
    border-top-width: clamp(4px, .55vh, 10px);
    border-bottom-width: clamp(4px, .55vh, 10px);
}

.obs-stage .current-job-panel h1 {
    margin-bottom: clamp(18px, 2.2vh, 36px);
    font-size: clamp(56px, 6.5vh, 112px);
}

.obs-stage .current-job-panel p {
    font-size: clamp(34px, 4vh, 68px);
    line-height: 1.32;
}

.obs-stage .caption-lines {
    gap: clamp(12px, 1.6vh, 26px);
}

.obs-stage .caption-line {
    border-left-width: clamp(8px, 1vw, 18px);
}

.obs-stage .caption-line span {
    font-size: clamp(34px, 4vh, 68px);
}

.obs-stage .voice-control {
    min-height: clamp(54px, 6vh, 108px);
    font-size: clamp(24px, 2.8vh, 48px);
}

.obs-stage .obs-voice-control {
    position: absolute;
    left: 50%;
    bottom: clamp(16px, 2vh, 32px);
    z-index: 5;
    width: min(86%, 820px);
    transform: translateX(-50%);
    opacity: .86;
}

.obs-body.voice-running .obs-voice-control {
    opacity: 0;
    pointer-events: none;
}
