/* ══════════════════════════════════════════════════════════
   korvali playstore — ply.css
   Playground / Terminal Theme (fully responsive)
   ══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-deep: #02040a;
    --panel: linear-gradient(145deg, #0b1329, #060d1f);
    --cyan: #22d3ee;
    --cyan-soft: #a5f3fc;
    --cyan-deep: #0284c7;
    --blue: #38bdf8;
    --green: #4ade80;
    --amber: #fbbf24;
    --rose: #fb7185;
    --text: #e2e8f0;
    --text-strong: #f1f5f9;
    --text-dim: #8b949e;
    --line: rgba(34, 211, 238, 0.15);
    --line-soft: rgba(34, 211, 238, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Menlo', 'Consolas', monospace;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: 24px 16px 40px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: radial-gradient(ellipse at 30% 20%, #0b1329 0%, #02040a 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ─── Container Panel ─── */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 26px 28px 22px;
    background: var(--panel);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(34, 211, 238, 0.04);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.container:focus-within {
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(34, 211, 238, 0.07);
}

/* ─── Header ─── */
header {
    position: relative;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line-soft);
}

header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 130px;
    height: 1px;
    background: linear-gradient(to right, var(--cyan), transparent);
}

h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--cyan-soft);
    text-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
    word-break: break-word;
}

.tagline {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-dim);
}

/* ─── Section Title ─── */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(34, 211, 238, 0.15);
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    min-width: 20px;
    background: linear-gradient(to right, rgba(34, 211, 238, 0.25), transparent);
}

/* ─── Text ─── */
p {
    margin-bottom: 10px;
    font-size: 12.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.55);
}

strong {
    color: var(--text-strong);
    font-weight: 600;
}

/* ─── Code Blocks ─── */
pre {
    margin-bottom: 15px;
    padding: 13px 15px;
    background: rgba(2, 4, 10, 0.75);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    line-height: 1.65;
    color: var(--text);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.25) transparent;
}

code {
    font-family: inherit;
    font-size: 0.95em;
    color: var(--rose);
}

pre code {
    color: var(--cyan-soft);
    font-size: 12px;
    white-space: pre;
}

/* ─── Attribute Table ─── */
.attr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    font-size: 12px;
    background: rgba(2, 4, 10, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.attr-table th,
.attr-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-wrap: break-word;
    word-break: break-word;
}

.attr-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.attr-table tbody tr {
    transition: background 0.2s ease;
}

.attr-table tbody tr:hover {
    background: rgba(34, 211, 238, 0.045);
}

.attr-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Notice Box ─── */
.notice-box {
    margin-bottom: 20px;
    padding: 13px 15px;
    font-size: 11.5px;
    line-height: 1.75;
    color: #fda4af;
    background: rgba(251, 113, 133, 0.07);
    border: 1px solid rgba(251, 113, 133, 0.18);
    border-left: 4px solid var(--rose);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.notice-box strong {
    color: var(--rose);
}

.notice-box code {
    color: #fecdd3;
}

/* ─── Generator Card ─── */
.generator-card {
    margin-bottom: 24px;
    padding: 18px;
    background: rgba(2, 4, 10, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 40px rgba(34, 211, 238, 0.02);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.generator-card:focus-within {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.06);
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--cyan-soft);
}

input,
textarea {
    width: 100%;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-strong);
    background: rgba(2, 4, 10, 0.85);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 10px;
    outline: none;
    caret-color: var(--cyan);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.15);
}

input:focus,
textarea:focus {
    background: rgba(2, 4, 10, 0.95);
    border-color: var(--cyan);
    box-shadow:
        0 0 0 3px rgba(34, 211, 238, 0.08),
        0 0 20px rgba(34, 211, 238, 0.08);
}

textarea {
    min-height: 56px;
    resize: vertical;
}

#code_output {
    margin-bottom: 0;
    border-color: rgba(34, 211, 238, 0.2);
    border-style: dashed;
    background: rgba(0, 0, 0, 0.45);
}

/* ─── Output Header + Copy Button ─── */
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 6px;
}

.output-header label {
    margin-bottom: 0;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--cyan-soft);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.copy-btn:hover {
    background: rgba(34, 211, 238, 0.18);
    border-color: var(--cyan);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}

.copy-btn:active {
    transform: scale(0.96);
}

.copy-btn.copied {
    color: var(--green);
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(74, 222, 128, 0.12);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.25);
}

@media (max-width: 640px) {
    .output-header {
        flex-wrap: wrap;
    }

    .copy-btn {
        padding: 5px 10px;
        font-size: 10.5px;
    }
}

/* ─── Live Demo Grid ─── */
.demo-grid,
div[style*="auto-fit"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
    gap: 12px !important;
}

.demo-grid > *,
div[style*="auto-fit"] > * {
    min-width: 0;
    padding: 14px 16px;
    background: rgba(2, 4, 10, 0.6);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.demo-grid > *:hover,
div[style*="auto-fit"] > *:hover {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(34, 211, 238, 0.07);
    transform: translateY(-2px);
}

.demo-grid img,
div[style*="auto-fit"] img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ─── Footer ─── */
footer {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.28);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.25);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.45);
}

/* ─── Selection & Focus ─── */
::selection {
    background: rgba(34, 211, 238, 0.25);
    color: #fff;
}

:focus-visible {
    outline: 1px solid rgba(34, 211, 238, 0.6);
    outline-offset: 2px;
}

/* ─── Utilities ─── */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        padding: 16px 12px 32px;
    }

    .container {
        padding: 20px 18px 18px;
        border-radius: 22px;
    }

    h1 {
        font-size: 17px;
    }

    .section-title {
        font-size: 13px;
        margin: 22px 0 9px;
    }

    .attr-table th,
    .attr-table td {
        padding: 8px 10px;
        font-size: 11px;
    }

    .attr-table th {
        font-size: 10px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px 10px 28px;
        font-size: 13px;
    }

    .container {
        padding: 16px 14px 14px;
        border-radius: 18px;
    }

    header {
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 16px;
        gap: 8px;
    }

    .tagline {
        font-size: 11px;
    }

    .section-title {
        font-size: 12.5px;
        gap: 8px;
    }

    p {
        font-size: 12px;
    }

    pre {
        padding: 11px 12px;
        font-size: 11px;
        border-radius: 10px;
    }

    pre code {
        font-size: 11px;
    }

    .attr-table {
        font-size: 11px;
    }

    .attr-table th,
    .attr-table td {
        padding: 7px 9px;
        font-size: 10.5px;
    }

    .attr-table th {
        font-size: 9.5px;
        letter-spacing: 0.4px;
    }

    .notice-box {
        padding: 11px 12px;
        font-size: 11px;
        border-radius: 0 10px 10px 0;
    }

    .generator-card {
        padding: 14px;
        border-radius: 14px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    label {
        font-size: 10.5px;
    }

    input,
    textarea {
        padding: 8px 10px;
        font-size: 11.5px;
        border-radius: 8px;
    }

    .demo-grid,
    div[style*="auto-fit"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .demo-grid > *,
    div[style*="auto-fit"] > * {
        padding: 12px 13px;
        border-radius: 14px;
    }

    .demo-grid > *:hover,
    div[style*="auto-fit"] > *:hover {
        transform: none;
    }

    footer {
        margin-top: 26px;
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 8px 8px 22px;
    }

    .container {
        padding: 14px 11px 12px;
        border-radius: 16px;
    }

    h1 {
        font-size: 14.5px;
    }

    .tagline {
        font-size: 10.5px;
    }

    .section-title {
        font-size: 12px;
    }

    p {
        font-size: 11.5px;
    }

    pre {
        font-size: 10.5px;
        padding: 10px;
    }

    pre code {
        font-size: 10.5px;
    }

    .attr-table th,
    .attr-table td {
        padding: 6px 7px;
        font-size: 10px;
    }

    .attr-table th {
        font-size: 9px;
    }

    input,
    textarea {
        font-size: 11px;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}