/* =========================================================================
   つやつや金ぴか虹色立体パチンコ文字 Generator Style Sheet
   ========================================================================= */

:root {
    --bg-dark: #0a0b10;
    --panel-bg: rgba(18, 20, 32, 0.82);
    --panel-border: rgba(255, 215, 0, 0.25);
    --gold-primary: #ffd700;
    --gold-gradient: linear-gradient(135deg, #fff7a0 0%, #ffd700 50%, #b8860b 100%);
    --rainbow-gradient: linear-gradient(90deg, #ff0055, #ff9900, #33cc33, #00ccff, #9933ff, #ff0055);
    --text-light: #f0f4f8;
    --text-muted: #94a3b8;
    --accent-red: #ff2a5f;
    --accent-cyan: #00f0ff;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-glow: 0 0 25px rgba(255, 215, 0, 0.2);
}

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

body {
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 20% 15%, rgba(255, 215, 0, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 85%, rgba(255, 0, 128, 0.08) 0%, transparent 40%);
}

.app-container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

/* Header */
.app-header {
    margin-bottom: 20px;
    text-align: center;
}

.app-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

.app-header .badge {
    background: var(--gold-gradient);
    color: #000;
    font-weight: 900;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.app-header .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Workspace Layout */
.workspace {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

/* Preview Stage */
.preview-stage-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    border: 2px solid rgba(255, 215, 0, 0.4);
    background: #000;
}

.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#bgCanvas {
    z-index: 1;
}

#textCanvas {
    z-index: 2;
}

.stage-overlay-info {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.fps-counter, .resolution-tag {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--gold-primary);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Presets Quick Bar */
.presets-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    padding: 12px 18px;
    border-radius: var(--radius-md);
}

.presets-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold-primary);
    white-space: nowrap;
}

.btn-preset {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-light);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-preset:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.btn-preset.active {
    background: var(--gold-gradient);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* Control Panel */
.control-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.panel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.panel-header h2 {
    font-size: 1.15rem;
    color: var(--gold-primary);
}

.panel-scroll-area {
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: flex-start;
    flex-direction: column;
    gap: 18px;
}

.panel-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.panel-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.control-group {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px;
}

.group-title {
    display: block;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 12px;
    border-left: 4px solid var(--gold-primary);
    padding-left: 8px;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.input-field:last-child {
    margin-bottom: 0;
}

.input-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.input-field input[type="text"],
.input-field select {
    background: rgba(20, 24, 38, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field select option {
    background-color: #121526;
    color: #ffffff;
    padding: 10px;
    font-size: 0.9rem;
}

.input-field select option:checked {
    background-color: #2b3252;
    color: #ffd700;
    font-weight: 900;
}

.input-field input[type="text"]:focus,
.input-field select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.checkbox-row {
    grid-template-columns: 1fr;
    gap: 8px;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-light);
}

.input-field input[type="range"] {
    accent-color: var(--gold-primary);
    cursor: pointer;
}

/* Script Output Group */
.script-output-group {
    background: rgba(10, 15, 25, 0.6);
    border-color: rgba(255, 215, 0, 0.3);
}

.script-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-copy {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    font-weight: 900;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-copy:hover {
    transform: scale(1.05);
}

#scriptCodeOutput {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #00ffaa;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    padding: 8px;
    border-radius: 6px;
    resize: none;
    outline: none;
}

.action-buttons {
    margin-top: 10px;
}

.btn-download {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

/* Instructions Footer */
.instructions-section {
    margin-top: 40px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.instructions-section h2 {
    font-size: 1.3rem;
    color: var(--gold-primary);
    margin-bottom: 20px;
    text-align: center;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.instruction-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 18px;
    position: relative;
}

.step-num {
    position: absolute;
    top: -12px;
    left: 16px;
    width: 28px;
    height: 28px;
    background: var(--gold-gradient);
    color: #000;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.instruction-card h3 {
    font-size: 1rem;
    margin-top: 6px;
    margin-bottom: 8px;
    color: #fff;
}

.instruction-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.instruction-card code {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
