/* ============================================
   THE CREATOR BUILD BANK
   Liquid Glass Dashboard Theme
   by Golf Score Studio
   ============================================ */

/* ============================================
   THEME DEFINITIONS
   Each theme defines its own color palette
   ============================================ */

/* ---------- Brand Theme (Default) ---------- */
[data-theme="brand"] {
    /* Background Colors */
    --bg-primary: #0a1f14;
    --bg-secondary: #0d2818;
    --bg-accent: #122d1c;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(16, 185, 129, 0.15);
    --ambient-2: rgba(5, 150, 105, 0.12);
    --ambient-3: rgba(52, 211, 153, 0.08);
    --ambient-4: rgba(110, 231, 183, 0.06);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #e2f5ec;
    --text-secondary: rgba(226, 245, 236, 0.7);
    --text-muted: rgba(226, 245, 236, 0.5);
    
    /* Accent Colors */
    --accent-primary: #10b981;
    --accent-secondary: #34d399;
    --accent-tertiary: #6ee7b7;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-accent: #252525;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(64, 64, 64, 0.2);
    --ambient-2: rgba(82, 82, 82, 0.15);
    --ambient-3: rgba(115, 115, 115, 0.1);
    --ambient-4: rgba(163, 163, 163, 0.05);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #f5f5f5;
    --text-secondary: rgba(245, 245, 245, 0.7);
    --text-muted: rgba(245, 245, 245, 0.5);
    
    /* Accent Colors */
    --accent-primary: #525252;
    --accent-secondary: #737373;
    --accent-tertiary: #a3a3a3;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-accent: #e2e8f0;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(16, 185, 129, 0.08);
    --ambient-2: rgba(5, 150, 105, 0.06);
    --ambient-3: rgba(52, 211, 153, 0.04);
    --ambient-4: rgba(110, 231, 183, 0.03);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: rgba(30, 41, 59, 0.7);
    --text-muted: rgba(30, 41, 59, 0.5);
    
    /* Accent Colors */
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-tertiary: #047857;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ---------- Blue Theme (Dark Moody) ---------- */
[data-theme="blue"] {
    /* Background Colors */
    --bg-primary: #0a0f1a;
    --bg-secondary: #0d1525;
    --bg-accent: #121d2e;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(59, 130, 246, 0.15);
    --ambient-2: rgba(37, 99, 235, 0.12);
    --ambient-3: rgba(96, 165, 250, 0.08);
    --ambient-4: rgba(147, 197, 253, 0.06);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #e0e7ff;
    --text-secondary: rgba(224, 231, 255, 0.7);
    --text-muted: rgba(224, 231, 255, 0.5);
    
    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-tertiary: #93c5fd;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ---------- Red Theme (Dark Moody) ---------- */
[data-theme="red"] {
    /* Background Colors */
    --bg-primary: #1a0a0a;
    --bg-secondary: #250d0d;
    --bg-accent: #2e1212;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(239, 68, 68, 0.15);
    --ambient-2: rgba(220, 38, 38, 0.12);
    --ambient-3: rgba(248, 113, 113, 0.08);
    --ambient-4: rgba(252, 165, 165, 0.06);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #fee2e2;
    --text-secondary: rgba(254, 226, 226, 0.7);
    --text-muted: rgba(254, 226, 226, 0.5);
    
    /* Accent Colors */
    --accent-primary: #ef4444;
    --accent-secondary: #f87171;
    --accent-tertiary: #fca5a5;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ---------- Pink Theme (Dark Valentine) ---------- */
[data-theme="pink"] {
    /* Background Colors */
    --bg-primary: #1a0a14;
    --bg-secondary: #2d1024;
    --bg-accent: #3d1a32;
    
    /* Ambient Shape Colors */
    --ambient-1: rgba(236, 72, 153, 0.15);
    --ambient-2: rgba(219, 39, 119, 0.12);
    --ambient-3: rgba(244, 114, 182, 0.08);
    --ambient-4: rgba(251, 207, 232, 0.06);
    
    /* Glass Panel */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(244, 114, 182, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: #fce7f3;
    --text-secondary: rgba(252, 231, 243, 0.7);
    --text-muted: rgba(252, 231, 243, 0.5);
    
    /* Accent Colors */
    --accent-primary: #ec4899;
    --accent-secondary: #f472b6;
    --accent-tertiary: #f9a8d4;
    
    /* Card color palettes are defined in tccb-script.js → CONFIG.PALETTES */
}

/* ============================================
   GLOBAL CSS VARIABLES
   ============================================ */

:root {
    /* Spacing */
    --spacing-xxs:0.25rem;
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Card Sizes */
    --card-size: 70px;
    --card-size-large: 200px;
    
    /* Mobile Frame */
    --mobile-width: 375px;
    --mobile-height: 667px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
}

/* ============================================
   AMBIENT BACKGROUND
   ============================================ */

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s ease-in-out infinite;
    transition: background var(--transition-slow);
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--ambient-1);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--ambient-2);
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: var(--ambient-3);
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 300px;
    height: 300px;
    background: var(--ambient-4);
    top: 20%;
    right: 20%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -10px) scale(1.02); }
}

/* ============================================
   GLASS PANEL BASE
   ============================================ */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: background var(--transition-normal), 
                border-color var(--transition-normal),
                box-shadow var(--transition-normal);
}

/* ============================================
   APP CONTAINER
   ============================================ */

.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: var(--spacing-md);
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   HEADER (Matches Scorecard)
   ============================================ */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.header-left,
.header-right {
    flex: 1;
    min-width: 120px;
}

.header-left {
    display: flex;
    justify-content: flex-start;
}

.logo-link-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-link {
    display: block;
    transition: var(--transition-fast);
}

.logo-link:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.header-logo {
    height: 90px;
    width: auto;
}

[data-theme="light"] .header-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.main-site-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: var(--spacing-xs);
}

.main-site-link:hover {
    color: var(--accent-primary);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
}

.header-center {
    text-align: center;
    flex-shrink: 0;
}

.header-center h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

.follow-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.social-link img {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.social-link:hover img {
    opacity: 1;
}

/* ============================================
   WORKSPACE (Main Area)
   ============================================ */

.workspace {
    display: grid;
    grid-template-columns: auto 1fr 300px;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
}

/* Middle Column Container */
.middle-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ============================================
   MODULE BASE STYLES
   ============================================ */

.module {
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    min-height: 0;
    overflow: hidden;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.module-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.module-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.module-content {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Module Resize Handle */
.module-resize-handle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 16px;
    cursor: ns-resize;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.module-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
}

.module-resize-handle:hover {
    opacity: 1;
}

.module-resize-handle:hover::before {
    background: var(--accent-primary);
}

/* Make modules position relative for resize handle */
.attributes-module,
.bank-module,
.control-panel {
    position: relative;
}

/* ============================================
   CONTROL PANEL MODULE
   ============================================ */

.control-panel {
    grid-column: 3;
    grid-row: 1 / -1;
    height: 800px;
}

.control-panel .module-content {
    overflow-y: auto;
}

.control-group {
    margin-bottom: var(--spacing-md);
}

.control-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Toggle Buttons */
.toggle-buttons {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.toggle-btn {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: var(--transition-fast);
}

[data-theme="brand"] .toggle-btn,
[data-theme="dark"] .toggle-btn,
[data-theme="blue"] .toggle-btn,
[data-theme="red"] .toggle-btn,
[data-theme="pink"] .toggle-btn {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .toggle-btn {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme] .toggle-btn:hover:not(.active) {
    color: var(--accent-primary);
}

.toggle-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Theme Grid (2x3) */
.toggle-buttons.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: var(--transition-fast);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

input:checked + .slider {
    background: var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background: white;
}

/* Color Input */
.color-input {
    width: 40px;
    height: 30px;
    padding: 0;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.apply-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    margin-left: var(--spacing-xs);
    transition: var(--transition-fast);
}

.apply-btn:hover {
    background: var(--accent-secondary);
}

.color-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.randomize-btn {
    padding: var(--spacing-xs);
    min-width: 32px;
}

/* Reset Buttons */
.reset-group {
    border-top: 1px solid var(--glass-border);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.reset-buttons {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.reset-btn {
    flex: 1;
    min-width: 70px;
    padding: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.reset-btn.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.reset-btn.full-width {
    width: 100%;
    padding: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.control-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    font-style: italic;
}

/* ============================================
   RANDOMIZER MODULE
   ============================================ */

.randomizer-module {
    height: fit-content;
    flex-shrink: 0;
}

.randomizer-module .module-content {
    overflow: visible;
}

.randomizer-display {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 300px;
    margin: 0 auto var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.randomizer-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--spacing-md);
}

.randomizer-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.randomizer-result .card {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

.randomizer-result .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.randomizer-result .word-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-align: center;
    padding: var(--spacing-md);
    word-break: break-word;
}

.spinner-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-container.hidden {
    display: none;
}

.spinner-wheel {
    max-width: 100%;
    max-height: 100%;
}

.spinner-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--accent-primary);
    z-index: 10;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.spinner-empty {
    width: 100%;
    height: 100%;
    border: 3px dashed var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--spacing-md);
}

.shuffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.shuffle-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.shuffle-btn:active {
    transform: translateY(0);
}

.shuffle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.3rem;
}

/* ============================================
   BANK MODULE
   All bank-related styles consolidated here
   ============================================ */

/* Module positioning */
.bank-module {
    height: 318px;
}

/* Bank grid - the scrollable card container */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
    gap: var(--spacing-sm);
    align-content: start;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.bank-grid.drag-over {
    outline: 2px dashed var(--accent-primary);
    outline-offset: -2px;
    background: rgba(16, 185, 129, 0.05);
}

.bank-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--spacing-xl);
}

/* Bank input area - pinned to bottom */
.bank-input {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

.bank-input.hidden {
    display: none;
}

/* Word input textarea */
.word-input textarea {
    width: 100%;
    min-height: 50px;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    margin-bottom: var(--spacing-xs);
}

.word-input textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Image Upload Area */
.upload-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxs) var(--spacing-xxs);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.05);
}

.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
}

.upload-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Add button (used in both bank and attributes) */
.add-bulk-btn {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.add-bulk-btn:hover {
    background: var(--accent-secondary);
}

/* Cards */
.card {
    position: relative;
    width: var(--card-size);
    height: var(--card-size);
    min-width: var(--card-size);
    min-height: var(--card-size);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: grab;
    flex-shrink: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card.dragging {
    opacity: 0.8;
    cursor: grabbing;
    z-index: 1000;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.word-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    padding: var(--spacing-xs);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.15;
}

/* Card Color Edit Button */
.card-edit-color {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.card:hover .card-edit-color {
    opacity: 1;
}

.card-edit-color:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Card Remove Button */
.card-remove {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.card:hover .card-remove {
    opacity: 1;
}

/* ============================================
   ATTRIBUTES MODULE
   All attributes-related styles consolidated here
   ============================================ */

/* Module positioning */
.attributes-module {
    grid-column: 1;
    grid-row: 1 / -1;
    height: 800px;
}

/* Attributes table - the scrollable list of attribute rows */
.attributes-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Attribute input area - pinned to bottom */
.add-attribute-input {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

.add-attribute-input textarea {
    width: 100%;
    min-height: 50px;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    margin-bottom: var(--spacing-xs);
}

.add-attribute-input textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Attribute rows */
.attribute-row {
    display: flex;
    gap: var(--spacing-xs);
    align-items: stretch;
}

/* Attribute name cell */
.attribute-cell {
    position: relative;
    min-height: calc(var(--card-size) - 10px + 4px);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
}

.attribute-cell .card-edit-color {
    top: 2px;
    right: 2px;
}

.attribute-cell:hover .card-edit-color {
    opacity: 1;
}

.attribute-cell .attr-remove {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.attribute-cell:hover .attr-remove {
    opacity: 1;
}

.assignment-cell {
    min-width: calc(var(--card-size) - 10px + 4px);
    min-height: calc(var(--card-size) - 10px + 4px);
    width: fit-content;
    height: fit-content;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    align-content: flex-start;
    transition: var(--transition-fast);
}

.assignment-cell.drag-over {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
}

.assignment-cell .card {
    width: calc(var(--card-size) - 10px);
    height: calc(var(--card-size) - 10px);
}

.assignment-cell .card:hover .card-remove {
    opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */

.app-footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MOBILE SIZING MODE
   ============================================ */

.mobile-frame {
    display: none;
}

/* Floating Mobile Sizing Toggle */
.mobile-sizing-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur));
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mobile-sizing-toggle-floating .control-label {
    margin-bottom: 0;
    font-size: 0.75rem;
}

body.mobile-sizing-active {
    --card-size: 50px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
}

body.mobile-sizing-active .app-container {
    max-width: var(--mobile-width);
    margin: 0 auto;
    padding: var(--spacing-sm);
}

body.mobile-sizing-active .app-header {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-sm);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

body.mobile-sizing-active .header-left {
    justify-content: center;
    align-items: center;
}

body.mobile-sizing-active .header-right {
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: var(--spacing-sm);
}

body.mobile-sizing-active .header-logo {
    height: 40px;
}

body.mobile-sizing-active .main-site-link {
    font-size: 0.7rem;
}

body.mobile-sizing-active .header-center h1 {
    font-size: 1.1rem;
}

body.mobile-sizing-active .tagline {
    font-size: 0.7rem;
}

body.mobile-sizing-active .follow-label {
    display: none;
}

body.mobile-sizing-active .social-link {
    width: 26px;
    height: 26px;
}

body.mobile-sizing-active .social-link img {
    width: 14px;
    height: 14px;
}

body.mobile-sizing-active .workspace {
    grid-template-columns: auto 1.2fr;
    grid-template-rows: auto auto auto;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
}

body.mobile-sizing-active .middle-column {
    gap: var(--spacing-sm);
}

body.mobile-sizing-active .attributes-module {
    grid-column: 1;
    grid-row: 1 / 3;
    height: 650px;
}

body.mobile-sizing-active .randomizer-module {
    height: fit-content;
}

body.mobile-sizing-active .add-attribute-input {
    margin-top: auto;
}

body.mobile-sizing-active .bank-module {
    height: 368px;
    display: flex;
    flex-direction: column;
}

body.mobile-sizing-active .control-panel {
    grid-column: 1 / -1;
    grid-row: 3;
    height: auto;
}

body.mobile-sizing-active .module-header {
    padding: var(--spacing-xs) var(--spacing-sm);
}

body.mobile-sizing-active .module-title {
    font-size: 0.85rem;
}

body.mobile-sizing-active .module-content {
    padding: var(--spacing-sm);
}

body.mobile-sizing-active .randomizer-display {
    max-width: 200px;
    margin-bottom: var(--spacing-sm);
}

body.mobile-sizing-active .shuffle-btn {
    max-width: 200px;
    padding: var(--spacing-sm);
    font-size: 0.85rem;
}

body.mobile-sizing-active .btn-icon {
    font-size: 1rem;
}

body.mobile-sizing-active .attribute-row {
    gap: 2px;
    margin-bottom: 2px;
}

body.mobile-sizing-active .attribute-cell {
    min-width: 50px;
    padding: 4px 6px;
    font-size: 0.65rem;
}

body.mobile-sizing-active .assignment-cell {
    min-height: 40px;
    padding: 2px;
}

body.mobile-sizing-active .assignment-cell .card {
    width: calc(var(--card-size) - 12px);
    height: calc(var(--card-size) - 12px);
}

body.mobile-sizing-active .add-attribute-row input {
    padding: var(--spacing-xs);
    font-size: 0.75rem;
}

body.mobile-sizing-active .add-attr-btn {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
}

body.mobile-sizing-active .attr-bulk-input textarea,
body.mobile-sizing-active .word-bulk-input textarea {
    min-height: 50px;
    font-size: 0.75rem;
}

body.mobile-sizing-active .word-single-input input {
    padding: var(--spacing-xs);
    font-size: 0.8rem;
}

body.mobile-sizing-active .add-word-btn,
body.mobile-sizing-active .add-bulk-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
}

body.mobile-sizing-active .attributes-module .module-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.mobile-sizing-active .attributes-table {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

body.mobile-sizing-active .bank-module .module-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.mobile-sizing-active .bank-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
    gap: var(--spacing-xs);
}

body.mobile-sizing-active .card.word-card {
    font-size: 8px !important;
}

body.mobile-sizing-active .control-group {
    margin-bottom: var(--spacing-sm);
}

body.mobile-sizing-active .control-label {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

body.mobile-sizing-active .toggle-btn {
    padding: var(--spacing-xs);
    font-size: 0.7rem;
}

body.mobile-sizing-active .reset-buttons {
    gap: 2px;
}

body.mobile-sizing-active .reset-btn {
    font-size: 0.65rem;
    padding: var(--spacing-xs);
}

body.mobile-sizing-active .app-footer {
    padding: var(--spacing-sm);
    font-size: 0.7rem;
}

body.mobile-sizing-active .add-attribute-input textarea,
body.mobile-sizing-active .word-input textarea {
    min-height: 36px;
    font-size: 0.65rem;
    padding: 6px;
}

body.mobile-sizing-active .bank-empty {
    font-size: 0.7rem;
    white-space: nowrap;
    padding: var(--spacing-sm);
}

body.mobile-sizing-active .attributes-table .bank-empty {
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Smaller image upload area */
body.mobile-sizing-active .upload-area {
    height: 25px;
    border-radius: 5px;
}

body.mobile-sizing-active .upload-area .upload-icon {
    display: none;
}

body.mobile-sizing-active .upload-area .upload-text {
    font-size: 0.5rem;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1200px) {
    :root {
        --card-size: 65px;
    }
    
    .workspace {
        grid-template-columns: auto 1fr 280px;
        gap: var(--spacing-md);
    }
    
    .bank-module {
        height: 380px;
    }
    
    .randomizer-display {
        max-width: 250px;
    }
    
    .shuffle-btn {
        max-width: 250px;
    }
    
    .attribute-cell {
        font-size: 0.8rem;
    }
}

@media (max-width: 1000px) {
    :root {
        --card-size: 60px;
    }
    
    .workspace {
        grid-template-columns: auto 1.5fr;
        grid-template-rows: auto auto auto;
        gap: var(--spacing-md);
    }
    
    .attributes-module {
        grid-column: 1;
        grid-row: 1 / 3;
    }
    
    .middle-column {
        grid-column: 2;
        grid-row: 1 / 3;
    }
    
    .control-panel {
        grid-column: 1 / -1;
        grid-row: 3;
        height: auto;
    }
    
    .bank-module {
        height: 350px;
    }
    
    .randomizer-display {
        max-width: 280px;
    }
    
    .shuffle-btn {
        max-width: 220px;
    }
    
    .attribute-cell {
        min-width: 60px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    :root {
        --card-size: 50px;
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.5rem;
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
    }
    
    /* Header compact */
    .app-header {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-sm);
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-sm);
    }
    
    .header-left,
    .header-right {
        justify-content: center;
        align-items: center;
    }
    
    .header-logo {
        height: 40px;
    }
    
    .main-site-link {
        font-size: 0.7rem;
    }
    
    .header-center h1 {
        font-size: 1.1rem;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
    
    .header-right {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .follow-label {
        display: none;
    }
    
    .social-link {
        width: 26px;
        height: 26px;
    }
    
    .social-link img {
        width: 14px;
        height: 14px;
    }
    
    /* Mobile Grid Layout */
    .workspace {
        grid-template-columns: auto 1.2fr;
        grid-template-rows: auto auto auto;
        gap: var(--spacing-sm);
        padding: var(--spacing-xs);
    }
    
    .attributes-module {
        grid-column: 1;
        grid-row: 1 / 3;
        height: 600px;
    }
    
    .randomizer-module {
        height: fit-content;
    }
    
    .bank-module {
        height: 298px;
    }
    
    .control-panel {
        grid-column: 1 / -1;
        grid-row: 3;
        height: auto;
    }

    /* Hide mobile sizing toggle on actual mobile devices 
    .mobile-sizing-control {
        display: none;
    } */
    
    /* Smaller module styling */
    .module-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .module-title {
        font-size: 0.85rem;
    }
    
    .module-content {
        padding: var(--spacing-sm);
    }
    
    .randomizer-display {
        max-width: 230px;
        margin-bottom: var(--spacing-sm);
    }
    
    .shuffle-btn {
        max-width: 230px;
        padding: var(--spacing-sm);
        font-size: 0.85rem;
    }
    
    .btn-icon {
        font-size: 1rem;
    }

    /* Smaller attribute rows */
    .attribute-row {
        gap: 2px;
        margin-bottom: 2px;
    }
    
    .attribute-cell {
        min-width: 50px;
        padding: 4px 6px;
        font-size: 0.65rem;
    }
    
    .assignment-cell {
        min-height: 40px;
        padding: 2px;
    }
    
    .assignment-cell .card {
        width: calc(var(--card-size) - 6px);
        height: calc(var(--card-size) - 6px);
    }

    /* Smaller inputs */
    .add-attribute-input textarea,
    .word-input textarea {
        min-height: 36px;
        font-size: 0.65rem;
        padding: 6px;
    }
    
    .add-bulk-btn {
        padding: 6px;
        font-size: 0.75rem;
    }
    
    /* Smaller empty text */
    .bank-empty {
        font-size: 0.7rem;
        white-space: nowrap;
        padding: var(--spacing-sm);
    }

    .upload-area .upload-icon {
        display: none;
    }
    
    /* Smaller word cards */
    .card.word-card {
        font-size: 8px !important;
    }
    
    /* Control panel compact */
    .control-group {
        margin-bottom: var(--spacing-sm);
    }
    
    .control-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .toggle-btn {
        padding: var(--spacing-xs);
        font-size: 0.7rem;
    }
    
    .reset-buttons {
        gap: 2px;
    }
    
    .reset-btn {
        font-size: 0.65rem;
        padding: var(--spacing-xs);
    }
    
    /* Footer smaller */
    .app-footer {
        padding: var(--spacing-sm);
        font-size: 0.7rem;
    }
}

/* ============================================
   EXPORT BAR
   ============================================ */

.export-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.export-bar-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.export-bar-options {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.export-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.export-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.export-checkbox.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.export-checkbox.disabled input {
    cursor: not-allowed;
}

.capture-btn {
    margin-left: auto;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.capture-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.capture-btn:active {
    transform: translateY(0);
}

/* Mobile sizing */
body.mobile-sizing-active .export-bar {
    padding: var(--spacing-xs) var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-sm);
}

body.mobile-sizing-active .export-bar-title {
    font-size: 0.8rem;
}

body.mobile-sizing-active .export-bar-options {
    gap: var(--spacing-sm);
}

body.mobile-sizing-active .export-checkbox {
    font-size: 0.7rem;
}

body.mobile-sizing-active .export-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

body.mobile-sizing-active .capture-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .export-bar {
        padding: var(--spacing-xs) var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .export-bar-title {
        font-size: 0.85rem;
    }
    
    .export-checkbox {
        font-size: 0.75rem;
    }
    
    .capture-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }
}

/* ============================================
   TOUCH DEVICE ENHANCEMENTS
   ============================================ */

@media (pointer: coarse) {
    .module-resize-handle {
        height: 28px;
    }
    
    .module-resize-handle::before {
        width: 50px;
        height: 6px;
    }
    
    .card-remove,
    .card-edit-color,
    .attr-remove {
        opacity: 1;
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .attribute-cell .attr-remove {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   SHUFFLE ANIMATION
   ============================================ */

.shuffling .randomizer-placeholder {
    display: none;
}

.shuffling .randomizer-result {
    z-index: 1;
}

/* ============================================
   SPINNER ANIMATION
   ============================================ */

@keyframes spin-ease-out {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(var(--spin-degrees)); }
}
