/* ── #box をティッカー向けに上書き ── */
#box {
    max-width: 800px;
    height: auto;
    margin: 20px auto;
}

/* ── ティッカー表示エリア ── */
#ticker-wrap {
    position: relative;
    width: 100%;
    height: 50vw;
    min-height: 220px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

/* ── LED ドットマトリクス ── */
/* #ticker-wrap 自体をドット格子でマスク。
   wrap は静止しているので格子も動かない。
   テキストは wrap の内側でスクロールし、
   ドット位置を通過した部分だけ光って見える。
   円の隙間は透明になり、親要素の黒背景が "消灯" LED として見える。 */
#ticker-wrap.led-mode {
    -webkit-mask-image: radial-gradient(circle, white 40%, transparent 40%);
    -webkit-mask-size: var(--led-dot-size, 6px) var(--led-dot-size, 6px);
    -webkit-mask-repeat: repeat;
    mask-image: radial-gradient(circle, white 40%, transparent 40%);
    mask-size: var(--led-dot-size, 6px) var(--led-dot-size, 6px);
    mask-repeat: repeat;
}

/* LED モード コントロール */
#led-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#led-dot-size {
    width: 80px;
    accent-color: #FFD700;
}

#led-size-sub {
    display: none;
    align-items: center;
    gap: 6px;
}

#led-size-sub.visible {
    display: flex;
}

#led-size-label {
    font-size: 12px;
    min-width: 26px;
}

#ticker-track {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll linear infinite;
    will-change: transform;
}

#ticker-track span {
    font-size: 15vw;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 30px #FF8C00, 0 0 60px #FF4500;
    padding-right: 2em;
    -webkit-user-select: none;
    user-select: none;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* 全画面時 */
#ticker-wrap:fullscreen,
#ticker-wrap:-webkit-full-screen {
    background: #000;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* ── コントロールパネル ── */
#controls {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-top: 2px solid #333;
}

#controls label {
    color: #aaa;
    font-size: 13px;
    white-space: nowrap;
}

#text-input {
    flex: 1;
    min-width: 160px;
    padding: 8px 12px;
    font-size: 15px;
    border: 2px solid #444;
    border-radius: 6px;
    background: #222;
    color: #fff;
    outline: none;
}

#text-input:focus {
    border-color: #FFD700;
}

#controls button {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

#controls button:hover {
    opacity: 0.8;
}

#btn-set {
    background: #FFD700;
    color: #000;
}

#btn-toggle {
    background: #4CAF50;
    color: #fff;
}

#btn-toggle.paused {
    background: #e67e22;
}

#btn-fs {
    background: #3a7bd5;
    color: #fff;
}

#btn-reset {
    background: #555;
    color: #fff;
}

#speed-wrap,
#size-wrap,
#glow-wrap,
#font-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#speed,
#font-size,
#glow {
    width: 100px;
    accent-color: #FFD700;
}

#font-select {
    padding: 5px 8px;
    font-size: 13px;
    background: #222;
    color: #fff;
    border: 2px solid #444;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
}

#font-select:focus {
    border-color: #FFD700;
}

#color-wrap,
#bg-color-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#color-picker,
#bg-color-picker {
    width: 38px;
    height: 34px;
    border: none;
    background: none;
    cursor: pointer;
}

#hint {
    width: 100%;
    font-size: 11px;
    color: #666;
}

/* ── X シェアボタン ── */
.share-wrap {
    margin-top: 16px;
    text-align: center;
}

.btn-x-share {
    display: inline-block;
    padding: 10px 20px;
    background: #000;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 20px;
    transition: opacity 0.2s;
}

.btn-x-share:hover {
    opacity: 0.75;
}

/* ── タブレット (768px+) ── */
@media (min-width: 768px) {
    #box {
        width: 100%;
    }

    #ticker-wrap {
        height: 38vw;
        min-height: 300px;
    }
}

/* ── デスクトップ (1200px+) ── */
@media (min-width: 1200px) {
    #ticker-wrap {
        height: 35vw;
        min-height: 400px;
    }
}