/* ═══════════════════════════════════════════════════════════
   InsideGaming Contentplayer v1.2
   ═══════════════════════════════════════════════════════════ */

.igmed-player-wrap {
    min-height: 400px;
    background: var(--bg);
}

/* Loading */
.igmed-player-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 14px;
    padding: 80px 20px; color: var(--t3);
}
.igmed-player-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--s3); border-top-color: var(--yt);
    animation: igmed-spin .8s linear infinite;
}
@keyframes igmed-spin { to { transform: rotate(360deg); } }

/* Stage */
.igmed-player-stage {
    max-width: 1060px; margin: 0 auto;
    padding: 20px 20px 32px;
    box-sizing: border-box;
}

/* Embed */
.igmed-player-embed-wrap {
    border-radius: 10px; overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.igmed-player-ratio {
    position: relative; padding-top: 56.25%; background: #000;
}
.igmed-player-ratio iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: none; display: block;
}

/* Info section */
.igmed-player-info { margin-bottom: 20px; }

/* Source badge */
.igmed-player-badge-row { margin-bottom: 12px; }
.igmed-source-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700;
    padding: 5px 12px; border-radius: 5px; letter-spacing: .3px;
}
.igmed-source-badge svg { width: 14px; height: 14px; fill: #fff; }
.igmed-source-yt     { background: var(--yt); color: #fff; }
.igmed-source-twitch { background: var(--tw); color: #fff; }

/* Title — clean rendering, no forced hyphens */
.igmed-player-title {
    font-size: clamp(17px, 2.2vw, 26px);
    font-weight: 700; color: var(--t1);
    margin: 0 0 12px; line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    max-width: 100%;
    display: block;
}

/* Meta chips */
.igmed-player-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.igmed-meta-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--s2); border: 1px solid var(--bd);
    color: var(--t2); font-size: 12px; font-weight: 500;
    padding: 5px 10px; border-radius: 20px;
    white-space: nowrap;
}
.igmed-chip-icon { display: flex; align-items: center; }
.igmed-chip-icon svg { width: 12px; height: 12px; fill: currentColor; }

/* ── Twitch info card ─────────────────────────────────────── */
.igmed-twitch-info-card {
    display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
    background: var(--s2); border: 1px solid var(--bd);
    border-left: 3px solid var(--tw);
    border-radius: 8px; padding: 14px 16px;
    margin-bottom: 16px;
}
.igmed-twitch-game-cover {
    width: 56px; height: 76px;
    border-radius: 5px; object-fit: cover; flex-shrink: 0;
    border: 1px solid var(--bd);
}
.igmed-twitch-info-text {
    display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.igmed-twitch-streamer-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--tw);
    flex-shrink: 0;
}
.igmed-twitch-streamer-name {
    font-size: 15px; font-weight: 700; color: var(--t1);
}
.igmed-twitch-game-name {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--tw); margin-top: 3px; font-weight: 600;
}
.igmed-twitch-game-name svg { width: 12px; height: 12px; fill: currentColor; }
.igmed-twitch-open-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--tw); color: #fff;
    font-size: 13px; font-weight: 700; font-family: var(--f);
    padding: 9px 16px; border-radius: 6px;
    text-decoration: none; white-space: nowrap;
    margin-left: auto; transition: background .15s;
}
.igmed-twitch-open-btn svg { width: 13px; height: 13px; fill: #fff; }
.igmed-twitch-open-btn:hover { background: #772ce8; color: #fff; }

/* ── Description ──────────────────────────────────────────── */
.igmed-player-desc-wrap {
    background: var(--s2); border: 1px solid var(--bd);
    border-radius: 8px; overflow: hidden;
    margin-bottom: 16px;
}
.igmed-player-desc {
    font-size: 13px; color: var(--t2); line-height: 1.7;
    padding: 14px 16px 10px;
    margin: 0;
    max-height: 110px;
    overflow: hidden;
    transition: max-height .35s ease;
    word-break: break-word; overflow-wrap: break-word;
}
.igmed-player-desc.is-expanded { max-height: 800px; }
.igmed-player-desc a { color: #53fc18; text-decoration: none; }
.igmed-player-desc a:hover { text-decoration: underline; }
.igmed-player-desc br { display: block; content: ''; margin: 2px 0; }

.igmed-show-more-btn {
    display: block; width: 100%;
    background: none; border: none;
    border-top: 1px solid var(--bd);
    color: #53fc18; font-size: 13px; font-weight: 600;
    font-family: var(--f); padding: 9px 16px;
    cursor: pointer; text-align: left;
    transition: background .12s;
}
.igmed-show-more-btn:hover { background: var(--s3); }

/* ── Nav ──────────────────────────────────────────────────── */
.igmed-player-nav { padding-top: 4px; }
.igmed-back-btn {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--t3); font-size: 13px; font-weight: 500;
    text-decoration: none; background: none; border: none;
    cursor: pointer; font-family: var(--f);
    padding: 8px 12px; border-radius: 6px;
    border: 1px solid var(--bd);
    transition: color .15s, border-color .15s;
}
.igmed-back-btn svg { width: 16px; height: 16px; fill: currentColor; }
.igmed-back-btn:hover { color: #53fc18; border-color: #53fc18; text-decoration: none; }

/* ── Error ────────────────────────────────────────────────── */
.igmed-player-error {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 80px 20px; text-align: center; color: var(--t3);
}
.igmed-player-error svg { width: 48px; height: 48px; fill: currentColor; }
.igmed-player-error h3 { font-size: 20px; color: var(--t1); margin: 0; }
.igmed-player-error p  { margin: 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media(max-width:640px){
    .igmed-player-stage { padding: 12px 12px 24px; }
    .igmed-twitch-info-card { flex-direction: column; align-items: flex-start; }
    .igmed-twitch-open-btn { margin-left: 0; width: 100%; justify-content: center; }
}
