*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --fg: #09090b;
    --fg-muted: #71717a;
    --fg-subtle: #a1a1aa;
    --border: #e4e4e7;
    --input-border: #e4e4e7;
    --ring: #18181b;
    --primary: #18181b;
    --primary-fg: #fafafa;
    --muted-bg: #f4f4f5;
    --radius: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Segoe UI Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--fg);
}

.logo-mark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary);
    color: var(--primary-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.logo-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-link {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: var(--fg);
    background: var(--muted-bg);
}

.nav-link.active {
    color: var(--fg);
}

/* Container */
.container {
    max-width: 780px;
    margin: 28px auto;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-header {
    padding: 20px 24px 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 13px;
    color: var(--fg-muted);
    margin-top: 2px;
}

.card-content {
    padding: 16px 24px 20px;
}

/* Form */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
}

.field-inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.field-inline .input {
    width: 70px;
}

.bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 16px;
}

.textarea {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 240px;
}

.textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 1px var(--ring);
}

.textarea::placeholder {
    color: var(--fg-subtle);
    font-family: var(--font);
}

.input {
    width: 70px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 1px var(--ring);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    outline: none;
    user-select: none;
    transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
}

.btn-primary:hover {
    opacity: 0.88;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ===== Slots Grid ===== */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.slot-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.slot-box-header {
    padding: 8px 12px;
    background: var(--muted-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-box-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    background: var(--primary);
    color: var(--primary-fg);
    flex-shrink: 0;
}

.slot-box-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-muted);
}

.slot-box-window {
    height: 56px;
    overflow: hidden;
    position: relative;
}

.slot-box-window::before,
.slot-box-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 14px;
    z-index: 2;
    pointer-events: none;
}

.slot-box-window::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-card), transparent);
}

.slot-box-window::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.slot-box-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot-box-item {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    width: 100%;
    flex-shrink: 0;
    padding: 0 12px;
    text-align: center;
    word-break: break-all;
}

/* Revealed state */
.slot-box.revealed {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.slot-box.revealed .slot-box-header {
    background: var(--primary);
    border-bottom-color: var(--primary);
}

.slot-box.revealed .slot-box-label {
    color: var(--primary-fg);
}

.slot-box.revealed .slot-box-num {
    background: var(--primary-fg);
    color: var(--primary);
}

/* Info Bar */
.info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--muted-bg);
    border-radius: var(--radius);
}

.info-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
}

.info-cell {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 10px;
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    margin-bottom: 1px;
}

.info-value {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 12px;
    color: var(--fg);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--fg-subtle);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--fg);
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 0 16px;
        margin: 16px auto;
    }

    .card-header,
    .card-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .bottom-row {
        flex-direction: column;
        align-items: stretch;
    }

    .field-inline {
        justify-content: space-between;
    }

    .info-bar {
        flex-direction: column;
        gap: 10px;
    }

    .info-sep {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}