/* CSS file for Cell : YouDreamStoryGame
   Purpose: YouDream story-to-game studio that generates self-contained HTML/JS games and renders them in a sandboxed iframe.
*/

:root {
    --ydsg-bg-1: #fff7ed;
    --ydsg-bg-2: #f0f9ff;
    --ydsg-ink: #172033;
    --ydsg-muted: #667085;
    --ydsg-card: rgba(255,255,255,0.82);
    --ydsg-card-strong: rgba(255,255,255,0.96);
    --ydsg-border: rgba(15,23,42,0.10);
    --ydsg-shadow: 0 22px 70px rgba(15,23,42,0.18);
    --ydsg-shadow-soft: 0 12px 34px rgba(15,23,42,0.12);
    --ydsg-radius-xl: 30px;
    --ydsg-radius-lg: 24px;
    --ydsg-radius-md: 16px;
    --ydsg-radius-pill: 999px;
    --ydsg-purple: #7c3aed;
    --ydsg-pink: #ec4899;
    --ydsg-blue: #0ea5e9;
    --ydsg-green: #10b981;
    --ydsg-yellow: #f59e0b;
}

.ydsg-root {
    position: fixed;
    inset: 0;
    z-index: 999999;
    box-sizing: border-box;
    padding: clamp(10px, 1.6vw, 22px);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
    color: var(--ydsg-ink);
    background:
        radial-gradient(circle at 12% 10%, rgba(236,72,153,0.24), transparent 29%),
        radial-gradient(circle at 84% 14%, rgba(14,165,233,0.27), transparent 28%),
        radial-gradient(circle at 52% 96%, rgba(16,185,129,0.19), transparent 34%),
        linear-gradient(135deg, var(--ydsg-bg-1), var(--ydsg-bg-2));
    overflow: hidden;
}

.ydsg-root *,
.ydsg-root *::before,
.ydsg-root *::after {
    box-sizing: border-box;
}

.ydsg-shell {
    position: relative;
    width: min(1440px, 100%);
    height: min(900px, 100%);
    min-height: 620px;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.62);
    border-radius: var(--ydsg-radius-xl);
    background: linear-gradient(160deg, rgba(255,255,255,0.76), rgba(255,255,255,0.45));
    box-shadow: var(--ydsg-shadow);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.ydsg-sky-orb {
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.48;
    pointer-events: none;
    animation: ydsgFloatOrb 9s ease-in-out infinite;
}

.ydsg-sky-orb.one {
    top: -88px;
    left: -68px;
    background: linear-gradient(135deg, rgba(124,58,237,0.28), rgba(236,72,153,0.18));
}

.ydsg-sky-orb.two {
    right: -80px;
    bottom: -78px;
    background: linear-gradient(135deg, rgba(14,165,233,0.25), rgba(16,185,129,0.20));
    animation-delay: -3s;
}

.ydsg-sky-orb.three {
    width: 150px;
    height: 150px;
    right: 26%;
    top: -70px;
    background: linear-gradient(135deg, rgba(245,158,11,0.23), rgba(236,72,153,0.16));
    animation-delay: -6s;
}

@keyframes ydsgFloatOrb {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(14px,-10px,0) scale(1.05); }
}

.ydsg-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px 13px;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    background: rgba(255,255,255,0.58);
}

.ydsg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ydsg-logo {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    background:
        radial-gradient(circle at 30% 26%, rgba(255,255,255,0.95), transparent 28%),
        linear-gradient(135deg, #7c3aed, #ec4899 52%, #f59e0b);
    color: #ffffff;
    font-size: 27px;
    box-shadow: 0 12px 28px rgba(124,58,237,0.25);
}

.ydsg-title-wrap { min-width: 0; }

.ydsg-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ydsg-title {
    margin: 2px 0 0;
    font-size: clamp(23px, 2.2vw, 36px);
    line-height: 1.03;
    letter-spacing: -0.05em;
    font-weight: 1000;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ydsg-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.ydsg-icon-btn,
.ydsg-close-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #111827;
    background: rgba(255,255,255,0.86);
    box-shadow: 0 8px 22px rgba(15,23,42,0.10);
    font-size: 18px;
    font-weight: 950;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ydsg-icon-btn:hover,
.ydsg-close-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,1);
    box-shadow: 0 14px 30px rgba(15,23,42,0.14);
}

.ydsg-body.ydsg-code-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 390px minmax(420px, 1fr) 300px;
    gap: 14px;
    height: calc(100% - 85px);
    padding: 14px;
}

.ydsg-panel {
    min-height: 0;
    border: 1px solid var(--ydsg-border);
    border-radius: var(--ydsg-radius-lg);
    background: var(--ydsg-card);
    box-shadow: var(--ydsg-shadow-soft);
    overflow: hidden;
}

.ydsg-control-panel,
.ydsg-insight-panel,
.ydsg-game-panel {
    display: flex;
    flex-direction: column;
}

.ydsg-panel-head {
    padding: 15px 16px 10px;
}

.ydsg-panel-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 1000;
    letter-spacing: -0.03em;
}

.ydsg-panel-subtitle {
    margin: 5px 0 0;
    color: var(--ydsg-muted);
    font-size: 12px;
    line-height: 1.42;
}

.ydsg-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 0 16px 16px;
    min-height: 0;
    flex: 1;
}

.ydsg-label {
    display: block;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #344054;
    margin-bottom: 7px;
}

.ydsg-input,
.ydsg-select,
.ydsg-textarea {
    width: 100%;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 16px;
    outline: none;
    background: rgba(255,255,255,0.86);
    color: #101828;
    font: inherit;
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ydsg-input,
.ydsg-select {
    height: 44px;
    padding: 0 13px;
}

.ydsg-readonly-input {
    color: #5b21b6;
    font-weight: 900;
    background: rgba(124,58,237,0.08);
}

.ydsg-textarea {
    min-height: 220px;
    flex: 1;
    resize: none;
    padding: 13px;
    line-height: 1.45;
}

.ydsg-story-textarea {
    min-height: 260px;
}

.ydsg-input:focus,
.ydsg-select:focus,
.ydsg-textarea:focus {
    background: rgba(255,255,255,0.98);
    border-color: rgba(124,58,237,0.42);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.10);
}

.ydsg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ydsg-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}

.ydsg-actions-row {
    display: grid;
    grid-template-columns: 1fr 135px;
    gap: 8px;
}

.ydsg-actions-row .ydsg-ghost-btn {
    grid-column: 1 / -1;
}

.ydsg-primary-btn,
.ydsg-secondary-btn,
.ydsg-ghost-btn,
.ydsg-mini-btn {
    border: 0;
    cursor: pointer;
    border-radius: var(--ydsg-radius-pill);
    min-height: 44px;
    padding: 11px 15px;
    font-size: 13px;
    font-weight: 1000;
    letter-spacing: -0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ydsg-primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #ec4899 58%, #f59e0b);
    box-shadow: 0 14px 34px rgba(124,58,237,0.28);
}

.ydsg-xl-btn {
    min-height: 50px;
    font-size: 14px;
}

.ydsg-secondary-btn {
    color: #111827;
    background: rgba(255,255,255,0.90);
    border: 1px solid rgba(15,23,42,0.10);
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}

.ydsg-ghost-btn {
    color: #475467;
    background: rgba(255,255,255,0.46);
    border: 1px dashed rgba(15,23,42,0.14);
}

.ydsg-primary-btn:hover,
.ydsg-secondary-btn:hover,
.ydsg-ghost-btn:hover,
.ydsg-mini-btn:hover {
    transform: translateY(-1px);
}

.ydsg-primary-btn:disabled,
.ydsg-secondary-btn:disabled,
.ydsg-ghost-btn:disabled,
.ydsg-mini-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.ydsg-mini-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.ydsg-mini-btn {
    min-height: 36px;
    padding: 8px 10px;
    color: #344054;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(15,23,42,0.10);
    font-size: 11px;
    box-shadow: 0 6px 14px rgba(15,23,42,0.06);
}

.ydsg-status {
    min-height: 44px;
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(15,23,42,0.04);
    color: #344054;
    font-size: 12px;
    line-height: 1.35;
}

.ydsg-status strong { color: #111827; }

.ydsg-game-panel {
    position: relative;
    min-width: 0;
}

.ydsg-game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    background: rgba(255,255,255,0.58);
}

.ydsg-game-title {
    font-size: 16px;
    font-weight: 1000;
    letter-spacing: -0.02em;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ydsg-game-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ydsg-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--ydsg-radius-pill);
    background: rgba(124,58,237,0.10);
    color: #5b21b6;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.ydsg-stage-wrap,
.ydsg-iframe-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 12px;
    background:
        radial-gradient(circle at 20% 12%, rgba(255,255,255,0.78), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.40), rgba(255,255,255,0.18));
}

.ydsg-game-frame {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    border-radius: 24px;
    display: block;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05), 0 16px 38px rgba(15,23,42,0.10);
}

.ydsg-insight-panel {
    min-width: 0;
}

.ydsg-template-cloud {
    padding: 0 14px 12px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ydsg-template-chip {
    border-radius: 17px;
    background: rgba(255,255,255,0.64);
    border: 1px solid rgba(255,255,255,0.72);
    padding: 9px 10px;
    box-shadow: 0 7px 18px rgba(15,23,42,0.06);
}

.ydsg-template-chip strong {
    display: block;
    font-size: 12px;
    font-weight: 1000;
    color: #111827;
    margin-bottom: 3px;
}

.ydsg-template-chip span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    color: var(--ydsg-muted);
}

.ydsg-quality-card {
    margin: auto 14px 14px;
    border-radius: 20px;
    padding: 12px;
    background: rgba(17,24,39,0.88);
    color: #ffffff;
    box-shadow: 0 18px 44px rgba(15,23,42,0.18);
}

.ydsg-quality-title {
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.76);
}

.ydsg-quality-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    line-height: 1.28;
}

.ydsg-quality-row:first-child { border-top: 0; }
.ydsg-quality-row span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 1000;
}
.ydsg-quality-row.ok span { background: rgba(16,185,129,0.22); color: #bbf7d0; }
.ydsg-quality-row.pending span { background: rgba(255,255,255,0.10); color: #e5e7eb; }
.ydsg-quality-row.working { color: #fef3c7; font-weight: 900; }

.ydsg-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000001;
    width: min(420px, calc(100vw - 28px));
    border-radius: 20px;
    padding: 13px 15px;
    color: #ffffff;
    background: rgba(17,24,39,0.94);
    box-shadow: 0 18px 44px rgba(15,23,42,0.28);
    font-size: 13px;
    line-height: 1.38;
    text-align: center;
}

.ydsg-spec-drawer {
    position: absolute;
    z-index: 30;
    top: 88px;
    right: 16px;
    bottom: 16px;
    width: min(560px, calc(100% - 32px));
    border-radius: 24px;
    background: rgba(17,24,39,0.95);
    color: #ffffff;
    box-shadow: 0 26px 70px rgba(15,23,42,0.30);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.16);
}

.ydsg-spec-drawer.open { display: flex; }

.ydsg-spec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    font-weight: 1000;
}

.ydsg-spec-body {
    flex: 1;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
    font-family: "Consolas", "SFMono-Regular", Menlo, monospace;
    font-size: 11px;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .ydsg-body.ydsg-code-body {
        grid-template-columns: 370px 1fr;
        grid-template-rows: 1fr auto;
    }

    .ydsg-insight-panel {
        grid-column: 1 / -1;
        min-height: 180px;
    }

    .ydsg-template-cloud {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .ydsg-template-chip {
        min-width: 190px;
    }

    .ydsg-quality-card {
        margin-top: 0;
    }
}

@media (max-width: 920px) {
    .ydsg-shell {
        height: 100%;
        min-height: 0;
    }

    .ydsg-body.ydsg-code-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(560px, 1fr) auto;
        overflow: auto;
    }

    .ydsg-control-panel { min-height: 430px; }
    .ydsg-game-panel { min-height: 620px; }
    .ydsg-story-textarea { min-height: 160px; }
}

@media (max-width: 620px) {
    .ydsg-root { padding: 0; }

    .ydsg-shell {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .ydsg-header { padding: 12px; }

    .ydsg-logo {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 22px;
    }

    .ydsg-kicker { font-size: 9px; letter-spacing: 0.08em; }
    .ydsg-title { font-size: 20px; }

    .ydsg-body.ydsg-code-body {
        padding: 10px;
        gap: 10px;
        grid-template-rows: auto minmax(520px, 1fr) auto;
    }

    .ydsg-row,
    .ydsg-actions-row,
    .ydsg-mini-actions {
        grid-template-columns: 1fr;
    }

    .ydsg-actions-row .ydsg-ghost-btn { grid-column: auto; }

    .ydsg-game-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ydsg-game-meta { justify-content: flex-start; }

    .ydsg-game-frame { min-height: 500px; border-radius: 20px; }

    .ydsg-spec-drawer {
        top: 70px;
        right: 8px;
        bottom: 8px;
        width: calc(100% - 16px);
    }
}


/* Story Game Store upgrades */
.ydsg-store-header-btn {
    min-width: 96px;
    height: 42px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #111827;
    background: rgba(255,255,255,0.88);
    box-shadow: 0 8px 22px rgba(15,23,42,0.10);
    font-size: 12px;
    font-weight: 1000;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ydsg-store-header-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,1);
    box-shadow: 0 14px 30px rgba(15,23,42,0.14);
}

.ydsg-save-mini-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    box-shadow: 0 9px 22px rgba(14,165,233,0.18);
}

.ydsg-store-overlay {
    position: absolute;
    z-index: 42;
    inset: 0;
    display: none;
    padding: 18px;
    background:
        radial-gradient(circle at 14% 14%, rgba(236,72,153,0.25), transparent 24%),
        radial-gradient(circle at 84% 20%, rgba(14,165,233,0.25), transparent 26%),
        rgba(15,23,42,0.48);
    backdrop-filter: blur(14px);
}

.ydsg-store-overlay.open {
    display: grid;
    place-items: center;
}

.ydsg-store-modal {
    width: min(1180px, 100%);
    height: min(760px, 100%);
    display: grid;
    grid-template-rows: auto auto 1fr;
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 16%, rgba(255,255,255,0.92), transparent 20%),
        linear-gradient(145deg, rgba(255,255,255,0.96), rgba(240,249,255,0.90));
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: 0 34px 90px rgba(15,23,42,0.36);
}

.ydsg-store-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(15,23,42,0.08);
    background: rgba(255,255,255,0.64);
}

.ydsg-store-title {
    margin: 2px 0 3px;
    font-size: clamp(28px, 4vw, 46px);
    letter-spacing: -0.07em;
    line-height: 0.98;
    font-weight: 1000;
    color: #111827;
}

.ydsg-store-subtitle {
    margin: 0;
    color: var(--ydsg-muted);
    font-size: 13px;
    line-height: 1.42;
    max-width: 620px;
}

.ydsg-store-tools {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 210px auto;
    gap: 10px;
    align-items: center;
    padding: 13px 18px;
    background: rgba(255,255,255,0.42);
    border-bottom: 1px solid rgba(15,23,42,0.06);
}

.ydsg-store-search,
.ydsg-store-filter {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 17px;
    outline: none;
    background: rgba(255,255,255,0.88);
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    color: #111827;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.ydsg-store-search:focus,
.ydsg-store-filter:focus {
    border-color: rgba(124,58,237,0.42);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.10);
}

.ydsg-store-count {
    min-width: 90px;
    height: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 14px;
    background: rgba(17,24,39,0.90);
    color: #ffffff;
    font-size: 12px;
    font-weight: 1000;
    white-space: nowrap;
}

.ydsg-store-grid {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.ydsg-store-card {
    min-height: 342px;
    display: grid;
    grid-template-rows: 154px 1fr;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255,255,255,0.80);
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: 0 16px 42px rgba(15,23,42,0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ydsg-store-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 58px rgba(15,23,42,0.17);
}

.ydsg-store-card-art {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.92), transparent 25%),
        linear-gradient(135deg, rgba(124,58,237,0.26), rgba(236,72,153,0.20), rgba(245,158,11,0.18));
}

.ydsg-store-card-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.02);
}

.ydsg-store-card-art.no-img {
    display: grid;
    place-items: center;
}

.ydsg-store-art-icon {
    width: 76px;
    height: 76px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-size: 42px;
    background: rgba(255,255,255,0.78);
    box-shadow: 0 18px 38px rgba(15,23,42,0.14);
}

.ydsg-store-badge {
    position: absolute;
    left: 11px;
    bottom: 10px;
    max-width: calc(100% - 22px);
    border-radius: 999px;
    padding: 8px 11px;
    color: #ffffff;
    background: rgba(17,24,39,0.76);
    backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 1000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ydsg-store-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px;
    min-height: 0;
}

.ydsg-store-card-title {
    font-size: 15px;
    line-height: 1.12;
    font-weight: 1000;
    letter-spacing: -0.03em;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

.ydsg-store-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ydsg-store-card-meta span {
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(124,58,237,0.09);
    color: #5b21b6;
    font-size: 10px;
    font-weight: 1000;
}

.ydsg-store-card-instruction {
    color: var(--ydsg-muted);
    font-size: 12px;
    line-height: 1.35;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ydsg-store-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 7px;
    margin-top: 3px;
}

.ydsg-store-play-btn,
.ydsg-store-light-btn,
.ydsg-store-delete-btn {
    border: 0;
    cursor: pointer;
    min-height: 36px;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 1000;
    transition: transform .16s ease, box-shadow .16s ease;
}

.ydsg-store-play-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 10px 24px rgba(124,58,237,0.22);
}

.ydsg-store-light-btn {
    color: #111827;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(15,23,42,0.08);
}

.ydsg-store-delete-btn {
    color: #991b1b;
    background: rgba(254,226,226,0.86);
}

.ydsg-store-play-btn:hover,
.ydsg-store-light-btn:hover,
.ydsg-store-delete-btn:hover {
    transform: translateY(-1px);
}

.ydsg-store-empty {
    grid-column: 1 / -1;
    min-height: 360px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 30px;
    border-radius: 30px;
    background: rgba(255,255,255,0.62);
    border: 1px dashed rgba(15,23,42,0.16);
}

.ydsg-store-empty-icon {
    font-size: 66px;
    margin-bottom: 12px;
}

.ydsg-store-empty h3 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.ydsg-store-empty p {
    margin: 8px auto 0;
    color: var(--ydsg-muted);
    max-width: 420px;
    line-height: 1.45;
    font-size: 13px;
}

@media (max-width: 920px) {
    .ydsg-mini-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .ydsg-store-overlay {
        padding: 8px;
    }

    .ydsg-store-modal {
        height: 100%;
        border-radius: 24px;
    }

    .ydsg-store-head {
        padding: 16px;
    }

    .ydsg-store-tools {
        grid-template-columns: 1fr;
    }

    .ydsg-store-count {
        width: max-content;
    }

    .ydsg-store-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .ydsg-store-card {
        grid-template-rows: 140px 1fr;
        min-height: 318px;
    }
}

@media (max-width: 520px) {
    .ydsg-store-header-btn {
        min-width: 42px;
        font-size: 0;
    }

    .ydsg-store-header-btn::before {
        content: "🎮";
        font-size: 18px;
    }

    .ydsg-store-card-actions {
        grid-template-columns: 1fr;
    }
}
