/* ============================================
   MINIMAL CSS FOR MATERIAL DESIGN 3 MIGRATION
   
   MD3 will provide: buttons, cards, inputs, dialogs, 
   badges, toasts, modals, etc.
   
   This file contains ONLY:
   - CSS Variables (for MD3 theming)
   - App-specific layout
   - Custom game visualizations
   ============================================ */

/* Import MPA-specific styles */
@import url('/shared/styles/mpa.css');

/* ============================================
   CSS VARIABLES - MD3 DESIGN TOKENS
   ============================================ */
:root {
    /* MD3 Color Tokens */
    --md-sys-color-primary: #2563eb;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #1e40af;
    --md-sys-color-secondary: #0891b2;
    --md-sys-color-error: #ef4444;
    --md-sys-color-success: #10b981;
    --md-sys-color-warning: #f59e0b;
    
    --md-sys-color-surface: #0f172a;
    --md-sys-color-surface-variant: #1e293b;
    --md-sys-color-surface-container: #334155;
    --md-sys-color-on-surface: #f1f5f9;
    --md-sys-color-on-surface-variant: #cbd5e1;
    --md-sys-color-outline: #94a3b8;
    
    /* Legacy support (will be removed) */
    --bg-primary: var(--md-sys-color-surface);
    --bg-secondary: var(--md-sys-color-surface-variant);
    --bg-card: var(--md-sys-color-surface-container);
    --text-primary: var(--md-sys-color-on-surface);
    --text-secondary: var(--md-sys-color-on-surface-variant);
    --text-muted: var(--md-sys-color-outline);
    --primary: var(--md-sys-color-primary);
    --success: var(--md-sys-color-success);
    --danger: var(--md-sys-color-error);
    --warning: var(--md-sys-color-warning);
    
    /* MD3 Shape Tokens */
    --md-sys-shape-corner-none: 0;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    
    /* MD3 Spacing Scale */
    --md-sys-spacing-1: 4px;
    --md-sys-spacing-2: 8px;
    --md-sys-spacing-3: 12px;
    --md-sys-spacing-4: 16px;
    --md-sys-spacing-5: 20px;
    --md-sys-spacing-6: 24px;
    --md-sys-spacing-8: 32px;
    --md-sys-spacing-12: 48px;
    
    /* Legacy support */
    --spacing-xs: var(--md-sys-spacing-2);
    --spacing-sm: var(--md-sys-spacing-3);
    --spacing-md: var(--md-sys-spacing-4);
    --spacing-lg: var(--md-sys-spacing-6);
    --spacing-xl: var(--md-sys-spacing-8);
    
    /* MD3 Motion Tokens */
    --md-sys-motion-duration-short: 150ms;
    --md-sys-motion-duration-medium: 250ms;
    --md-sys-motion-duration-long: 400ms;
    --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-easing-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   APP LAYOUT
   ============================================ */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-4);
    display: grid;
    grid-template-columns: 0.8fr auto 1fr;
    align-items: center;
    border-bottom: 1px solid var(--md-sys-color-outline);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: var(--md-sys-spacing-4);
    /* Prevent header bounce on navigation */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-3);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-image {
    height: 48px;
    width: auto;
    vertical-align: middle;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--md-sys-spacing-2);
    flex-wrap: wrap;
}

.nav-link {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 6px 12px;
    border-radius: var(--md-sys-shape-corner-small);
    transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--md-sys-color-on-surface);
}

.nav-link-active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--md-sys-spacing-3);
    /* Smooth transition for wallet connection */
    transition: opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.header-right:not(.ready) {
    opacity: 0;
}

/* Wallet Info */
.btn-connect {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    padding: 8px 16px;
    border-radius: var(--md-sys-shape-corner-small);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-connect:hover {
    background: var(--md-sys-color-primary-container);
}

.wallet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.wallet-line {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.wallet-value {
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 600;
    font-family: 'Roboto Mono', 'Monaco', monospace;
    font-size: 0.875rem;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--md-sys-motion-duration-short);
    color: var(--md-sys-color-on-surface-variant);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.copy-btn.copied {
    background: rgba(76, 175, 80, 0.2);
    border-color: var(--md-sys-color-success);
    color: var(--md-sys-color-success);
}

.testnet-badge, .readonly-badge {
    background: var(--md-sys-color-warning);
    color: var(--md-sys-color-surface);
    padding: 6px 12px;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.testnet-badge:hover {
    background: var(--md-sys-color-warning-container);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.testnet-badge.mainnet {
    background: var(--md-sys-color-success);
    color: white;
}

.testnet-badge.mainnet:hover {
    background: var(--md-sys-color-success-container);
}

.testnet-badge .dropdown-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.readonly-badge {
    background: var(--md-sys-color-error);
    color: white;
    cursor: default;
}

/* Network Dropdown */
.network-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

.network-dropdown.hidden {
    display: none;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.network-dropdown-content {
    padding: 4px;
}

.network-option {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-small);
    transition: background 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.network-option:hover {
    background: var(--md-sys-color-surface-variant);
}

.network-option.active {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.network-option .network-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface);
}

.network-option.active .network-label {
    color: var(--md-sys-color-on-primary-container);
}

.network-option .network-chain-id {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.8;
}

.network-option.active .network-chain-id {
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.9;
}

/* Content Area */
.content {
    flex: 1;
    padding: var(--md-sys-spacing-4);
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* Footer */
.app-footer {
    background: var(--md-sys-color-surface-variant);
    padding: var(--md-sys-spacing-4);
    text-align: center;
    border-top: 1px solid var(--md-sys-color-outline);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--md-sys-spacing-4);
}

.footer-link {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--md-sys-motion-duration-short);
}

.footer-link:hover {
    color: var(--md-sys-color-primary);
}

.footer-button {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 600;
    transition: all var(--md-sys-motion-duration-short);
}

.footer-button:hover {
    color: var(--md-sys-color-warning);
    transform: scale(1.05);
}

.footer-separator {
    color: var(--md-sys-color-outline);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5em;
    border: 2px solid var(--md-sys-color-outline);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.font-mono { font-family: 'Roboto Mono', 'Monaco', 'Courier New', monospace; }

/* ============================================
   ECONOMICAL LAYOUT COMPONENTS
   ============================================ */

/* Headers with badges */
.header-with-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--md-sys-spacing-4);
    flex-wrap: wrap;
    margin-bottom: var(--md-sys-spacing-4);
}

.contract-badges {
    display: flex;
    gap: var(--md-sys-spacing-2);
    flex-wrap: wrap;
}

/* Button groups */
.button-group {
    display: flex;
    gap: var(--md-sys-spacing-3);
}

.button-group .btn-play {
    flex: 1;
}

/* Compact forms */
.futures-form,
.discussion-form {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-1);
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.form-group small,
.form-hint {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

.char-counter {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-3);
}

.form-section {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    border: none;
}

.form-section summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    list-style-position: inside;
}

.form-section[open] summary {
    margin-bottom: var(--md-sys-spacing-3);
}

.form-actions {
    display: flex;
    gap: var(--md-sys-spacing-3);
    justify-content: flex-end;
}

.form-actions .btn-secondary,
.form-actions .btn-primary {
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
}

/* Value Input Component */
.value-input-component {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
}

.value-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--md-sys-spacing-3);
}

.value-input-header label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.unit-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline);
}

.unit-btn {
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface-variant);
    border: none;
    border-right: 1px solid var(--md-sys-color-outline);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.unit-btn:last-child {
    border-right: none;
}

.unit-btn:hover {
    background: var(--md-sys-color-surface-variant);
}

.unit-btn.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.value-input {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
}

.value-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.value-conversion {
    display: flex;
    justify-content: space-between;
    gap: var(--md-sys-spacing-3);
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

.conversion-info,
.min-value-info {
    display: flex;
    gap: var(--md-sys-spacing-1);
}

.conversion-label,
.min-label {
    font-weight: 600;
}

.conversion-value {
    font-family: 'Courier New', monospace;
}

.min-value {
    font-family: 'Courier New', monospace;
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

.value-warning {
    margin-top: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-2);
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
    display: none;
}

/* Stats bar */
.board-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--md-sys-spacing-3);
    margin-bottom: var(--md-sys-spacing-6);
}

.stat-card {
    background: var(--md-sys-color-surface-variant);
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-medium);
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
    text-transform: uppercase;
    margin-bottom: var(--md-sys-spacing-1);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Page headers */
.page-header {
    text-align: center;
    padding: var(--md-sys-spacing-6) var(--md-sys-spacing-4);
    margin-bottom: var(--md-sys-spacing-6);
}

.page-header h1 {
    margin-bottom: var(--md-sys-spacing-2);
}

.page-header p {
    color: var(--md-sys-color-on-surface-variant);
}

/* Create section */
.create-section {
    margin-bottom: var(--md-sys-spacing-6);
}

.btn-toggle-create {
    width: 100%;
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-medium);
    font-weight: 600;
    cursor: pointer;
}

.btn-toggle-create:hover {
    background: var(--md-sys-color-primary-container);
}

.create-form-container {
    margin-top: var(--md-sys-spacing-4);
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
}

.create-form-container h2 {
    margin-bottom: var(--md-sys-spacing-4);
}

/* Info section */
.info-section {
    margin-bottom: var(--md-sys-spacing-6);
}

.info-details {
    background: var(--md-sys-color-surface-variant);
    padding: var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-medium);
    border: none;
}

.info-details summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    list-style-position: inside;
}

.info-details[open] summary {
    margin-bottom: var(--md-sys-spacing-3);
}

.info-details ul {
    list-style-position: inside;
    color: var(--md-sys-color-on-surface-variant);
}

.info-details li {
    margin-bottom: var(--md-sys-spacing-1);
}

/* Discussion controls */
.discussion-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-4);
    gap: var(--md-sys-spacing-4);
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: var(--md-sys-spacing-2);
}

.filter-tabs .tab {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    font-size: 0.875rem;
}

.filter-tabs .tab:hover {
    background: var(--md-sys-color-surface-variant);
}

.filter-tabs .tab.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.sort-controls label {
    font-size: 0.875rem;
    font-weight: 600;
}

.sort-controls select {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
}

/* Loading states */
.loading-discussions {
    text-align: center;
    padding: var(--md-sys-spacing-6);
    color: var(--md-sys-color-outline);
}

/* ============================================
   GAME-SPECIFIC COMPONENTS
   (Cannot be replaced by MD3)
   ============================================ */

/* Game Lists - Staggered Animation */
.game-list, .tool-list {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
}

.game-card, .tool-card {
    animation: fadeInUp 0.4s var(--md-sys-motion-easing-emphasized) backwards;
}

.game-card:nth-child(1), .tool-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2), .tool-card:nth-child(2) { animation-delay: 0.10s; }
.game-card:nth-child(3), .tool-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4), .tool-card:nth-child(4) { animation-delay: 0.20s; }
.game-card:nth-child(5), .tool-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6), .tool-card:nth-child(6) { animation-delay: 0.30s; }
.game-card:nth-child(7), .tool-card:nth-child(7) { animation-delay: 0.35s; }
.game-card:nth-child(8), .tool-card:nth-child(8) { animation-delay: 0.40s; }
.game-card:nth-child(9), .tool-card:nth-child(9) { animation-delay: 0.45s; }
.game-card:nth-child(10), .tool-card:nth-child(10) { animation-delay: 0.50s; }
.game-card:nth-child(11), .tool-card:nth-child(11) { animation-delay: 0.55s; }
.game-card:nth-child(12), .tool-card:nth-child(12) { animation-delay: 0.60s; }
.game-card:nth-child(13), .tool-card:nth-child(13) { animation-delay: 0.65s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dice Gods - Dice Grid */
.dice-selection-area {
    margin: var(--md-sys-spacing-6) 0;
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--md-sys-spacing-3);
}

.dice-button {
    aspect-ratio: 1;
    background: var(--md-sys-color-surface-variant);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.dice-button:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-primary);
    transform: scale(1.05);
}

.dice-button.selected {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

@media (max-width: 768px) {
    .dice-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Satan, Moloch, Baal - Demon Cards */
.demon-standings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--md-sys-spacing-4);
    margin-bottom: var(--md-sys-spacing-6);
}

.demon-card {
    background: var(--md-sys-color-surface-container);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-6);
    text-align: center;
    transition: all var(--md-sys-motion-duration-medium);
}

.demon-card.leading {
    border-color: var(--md-sys-color-warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.demon-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--md-sys-spacing-2);
}

.demon-votes {
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

.demon-voting-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--md-sys-spacing-4);
}

.btn-demon {
    padding: var(--md-sys-spacing-6);
    background: var(--md-sys-color-surface-variant);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-medium);
    font-size: 1rem;
    font-weight: 600;
}

.btn-demon:hover {
    border-color: var(--md-sys-color-error);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .demon-voting-buttons {
        grid-template-columns: 1fr;
}
}

/* Distribution Visualizations (Histograms) */
.histogram-container {
    margin-top: var(--md-sys-spacing-4);
}

.histogram-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
}

.histogram-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
        gap: 4px;
    }
    
.histogram-bar {
    width: 100%;
    background: var(--md-sys-color-primary);
    border-radius: 4px 4px 0 0;
    transition: all var(--md-sys-motion-duration-short);
}

.histogram-bar-container:hover .histogram-bar {
    background: var(--md-sys-color-primary-container);
}

.bar-count {
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

.bar-label {
    font-size: 0.7rem;
    color: var(--md-sys-color-outline);
}

/* Median Visual */
.median-visual {
    margin-top: var(--md-sys-spacing-4);
}

.visual-section {
    display: flex;
    gap: var(--md-sys-spacing-3);
    margin-bottom: var(--md-sys-spacing-2);
}

.winning-section {
    background: rgba(16, 185, 129, 0.1);
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    flex: 1;
}

.losing-section {
    background: rgba(239, 68, 68, 0.1);
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    flex: 1;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.median-line {
    height: 2px;
    background: var(--md-sys-color-warning);
    margin: var(--md-sys-spacing-3) 0;
}

/* Number Line Visualization */
.number-line {
    margin-top: var(--md-sys-spacing-4);
}

.number-line-track {
    position: relative;
    height: 40px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    margin: var(--md-sys-spacing-4) 0;
}

.number-line-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--md-sys-motion-duration-short);
}

.play-marker {
    background: var(--md-sys-color-outline);
}

.user-marker {
    background: var(--md-sys-color-success);
    width: 12px;
    height: 12px;
}

.highlight-marker {
    background: var(--md-sys-color-primary);
    box-shadow: 0 0 8px var(--md-sys-color-primary);
}

.number-line-marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
}

.number-line-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

/* Distribution Marker */
.distribution-marker {
    position: relative;
    margin-top: var(--md-sys-spacing-4);
}

.marker-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: var(--md-sys-color-warning);
}

.marker-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--md-sys-color-warning);
    color: var(--md-sys-color-surface);
    padding: 2px 8px;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Contract Info Display */
.contract-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-3);
    flex-wrap: wrap;
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
}

/* Contract Information Section */
.contract-info-section {
    margin: var(--md-sys-spacing-4) 0;
}

.contract-details {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-4);
    margin-bottom: var(--md-sys-spacing-4);
}

.contract-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--md-sys-color-primary);
    padding: var(--md-sys-spacing-2);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.contract-details summary:hover {
    color: var(--md-sys-color-on-surface);
}

.contract-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--md-sys-spacing-4);
    margin-top: var(--md-sys-spacing-4);
}

.contract-info-card {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-4);
    border: 1px solid var(--md-sys-color-outline);
}

.contract-info-card h4 {
    margin: 0 0 var(--md-sys-spacing-3) 0;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    font-weight: 600;
}

.contract-card-header {
    margin-bottom: var(--md-sys-spacing-3);
    padding-bottom: var(--md-sys-spacing-3);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.contract-card-header h4 {
    margin: 0 0 var(--md-sys-spacing-1) 0;
    color: var(--md-sys-color-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.contract-card-description {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
}

.contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--md-sys-spacing-4);
}

.loading-contract-info {
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
}

.contract-label {
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.contract-address {
    font-family: 'Roboto Mono', monospace;
    color: var(--md-sys-color-on-surface);
    padding: 4px 8px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
}

.contract-badge {
    padding: 4px 8px;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.contract-badge:hover {
    transform: translateY(-2px);
}

.contract-badge-source {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.contract-badge-bytecode {
    background: var(--md-sys-color-secondary);
    color: white;
}

.contract-badge-abi {
    background: var(--md-sys-color-success);
    color: white;
}

/* Effects Canvas (for confetti, etc.) */
.effects-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   LEGACY CLASSES (Keep temporarily for JS)
   Will be replaced by MD3 components
   ============================================ */

/* These classes are referenced by JS but will be replaced */
.game-card, .tool-card {
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-4);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-medium);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.game-card::before, .tool-card::before {
    content: attr(data-emoji);
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 80px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    transition: all var(--md-sys-motion-duration-medium);
}

.game-card > *, .tool-card > * {
    position: relative;
    z-index: 1;
}

.game-card:hover, .tool-card:hover {
    border-color: var(--md-sys-color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.game-card:hover::before, .tool-card:hover::before {
    opacity: 0.15;
    transform: scale(1.1);
}

.game-card h3, .tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--md-sys-spacing-1);
}

.game-card p, .tool-card p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
    margin: 0;
}

/* Individual gradients for each game */
.game-card[data-game="pissing-contest"] {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: #3b82f6;
}

.game-card[data-game="pay-it-forward"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
}

.game-card[data-game="pay-it-backward"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
}

.game-card[data-game="message-board"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
}

.game-card[data-game="king-of-the-hill"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.game-card[data-game="last-call"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
}

.game-card[data-game="time-to-make-the-donuts"] {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    border-color: #ec4899;
}

.game-card[data-game="dice-gods"] {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    border-color: #a855f7;
}

.game-card[data-game="satan-moloch-baal"] {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
    border-color: #ef4444;
}

/* ============================================
   UNIFIED STATUS CARD SYSTEM
   Reusable across games, tools, discussions, factory
   ============================================ */

.status-list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.status-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-card {
    background: var(--md-sys-color-surface-container);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

/* Large faded emoji background on the right */
.status-card-bg-emoji {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 6rem;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
    user-select: none;
}

.status-card-clickable {
    cursor: pointer;
}

.status-card-clickable:focus {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--md-sys-color-primary) 0%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.status-card-clickable:hover {
    border-color: var(--md-sys-color-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.status-card-clickable:hover::before {
    opacity: 0.1;
}

.status-card-clickable:hover .status-card-bg-emoji {
    opacity: 0.12;
    transform: translateY(-50%) scale(1.05);
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.status-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.status-info {
    flex: 1;
    min-width: 0;
}

.status-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    display: inline;
    margin-right: 0.5rem;
}

.status-description {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.4;
    display: inline;
}

.status-data {
    padding-left: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    font-size: 0.8125rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    line-height: 1.4;
    text-align: right;
}

.status-value {
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
}

.status-separator {
    color: var(--md-sys-color-outline);
    margin: 0 0.25rem;
}

.status-details {
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 400;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--md-sys-color-outline);
}

.view-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
}

.btn-secondary {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

.loading-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1.1rem;
}

.error-state {
    color: var(--md-sys-color-error);
}

/* Game-specific gradient backgrounds for status cards */
.status-card[data-game="pissing-contest"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

.status-card[data-game="pissing-contest"]::before {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.status-card[data-game="pay-it-forward"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.5);
}

.status-card[data-game="pay-it-forward"]::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.status-card[data-game="pay-it-backward"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: rgba(139, 92, 246, 0.5);
}

.status-card[data-game="pay-it-backward"]::before {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.status-card[data-game="message-board"] {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(8, 145, 178, 0.15) 100%);
    border-color: rgba(14, 165, 233, 0.5);
}

.status-card[data-game="message-board"]::before {
    background: linear-gradient(135deg, #0ea5e9 0%, #0891b2 100%);
}

.status-card[data-game="king-of-the-hill"] {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-color: rgba(251, 191, 36, 0.5);
}

.status-card[data-game="king-of-the-hill"]::before {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.status-card[data-game="last-call"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
}

.status-card[data-game="last-call"]::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.status-card[data-game="time-to-make-the-donuts"] {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.5);
}

.status-card[data-game="time-to-make-the-donuts"]::before {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.status-card[data-game="dice-gods"] {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%);
    border-color: rgba(168, 85, 247, 0.5);
}

.status-card[data-game="dice-gods"]::before {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.status-card[data-game="satan-moloch-baal"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(153, 27, 27, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
}

.status-card[data-game="satan-moloch-baal"]::before {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
}

/* Responsive adjustments for status cards */
@media (max-width: 768px) {
    .status-list-container {
        padding: 1rem;
    }
    
    .status-card {
        padding: 0.875rem 1rem;
    }
    
    .status-icon {
        font-size: 2rem;
    }
    
    .status-title {
        font-size: 1rem;
    }
    
    .status-description {
        font-size: 0.75rem;
    }
    
    .status-data {
        font-size: 0.75rem;
    }
    
    .view-title {
        font-size: 1.5rem;
    }
    
    .status-card-bg-emoji {
        font-size: 4.5rem;
        right: -10px;
    }
    
    .status-data {
        padding-left: 3rem;
    }
}

/* Individual gradients for each tool */
.tool-card[data-tool="e-calculator"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
}

.tool-card[data-tool="pi-calculator"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
}

.tool-card[data-tool="tau-calculator"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
}

.tool-card[data-tool="sin-calculator"] {
    background: linear-gradient(135deg, #0891b2 0%, #065f75 100%);
    border-color: #0891b2;
}

.tool-card[data-tool="cos-calculator"] {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

.tool-card[data-tool="tanh-calculator"] {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    border-color: #a855f7;
}

.tool-card[data-tool="pow10-calculator"] {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    border-color: #ec4899;
}

.tool-card[data-tool="pow2-calculator"] {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #6366f1;
}

.tool-card[data-tool="ln-calculator"] {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border-color: #34d399;
}

.tool-card[data-tool="log2-calculator"] {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #fbbf24;
}

.tool-card[data-tool="log10-calculator"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
}

.tool-card[data-tool="sqrt-calculator"] {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-color: #0ea5e9;
}

.tool-card[data-tool="erf-calculator"] {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    border-color: #f43f5e;
}

/* Temporary component classes */
.game-interface, .game-controls, .game-sections,
.info-panel, .contest-info-panel, .info-grid, .info-item,
.winners-grid, .winner-item, .message-item, .discussion-card,
.stat-card, .play-history, .simulation-panel, .voting-interface,
.vote-distribution-panel, .calculator-controls {
    /* These will be replaced with MD3 components */
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-4);
}

/* Game sections spacing */
.game-sections {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-6);
    margin-top: var(--md-sys-spacing-6);
    overflow: visible;
}

/* Contest info panel enhancements */
.contest-info-panel {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contest-info-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Input group styling */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.input-group input,
.input-group textarea,
.input-group select {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    transition: border-color var(--md-sys-motion-duration-short);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Temporary button classes */
.btn-back, .btn-play, .btn-primary, .btn-toggle-create {
    /* These will be replaced with md-filled-button, md-text-button, etc. */
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    font-weight: 600;
}

.btn-back:hover, .btn-play:hover, .btn-primary:hover, .btn-toggle-create:hover {
    background: var(--md-sys-color-primary-container);
}

/* Temporary input classes */
.input, .wei-input, .message-input {
    /* These will be replaced with md-outlined-text-field */
    width: 100%;
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 768px) {
    .content {
        max-width: 900px;
        padding: var(--md-sys-spacing-8);
    }

    .game-list, .tool-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--md-sys-spacing-3);
    }
}

@media (min-width: 1024px) {
    .content {
        max-width: 1200px;
    }

    .app-header {
        padding: var(--md-sys-spacing-3) var(--md-sys-spacing-8);
    }

    .game-list, .tool-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .app-header {
        grid-template-columns: 1fr;
        gap: var(--md-sys-spacing-3);
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .header-right {
        justify-content: flex-start;
    }

    .contract-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* View Transitions API */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: var(--md-sys-motion-duration-medium);
}

/* ============================================
   DISCUSSION BOARD - NEW TABLE LAYOUT
   ============================================ */

/* Discussions Layout */
.discussions-layout {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-6);
}

/* Hero Header */
.hero-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: var(--md-sys-spacing-8);
    border-radius: var(--md-sys-shape-corner-large);
    position: relative;
    overflow: hidden;
}

.hero-bg-icon {
    position: absolute;
    top: -30px;
    right: -30px;
    font-size: 150px;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    color: white;
    font-size: 2rem;
    margin-bottom: var(--md-sys-spacing-3);
    font-weight: 700;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: var(--md-sys-spacing-6);
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--md-sys-spacing-4);
    margin-top: var(--md-sys-spacing-6);
}

.stat-box {
    background: rgba(255, 255, 255, 0.15);
    padding: var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-medium);
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: var(--md-sys-spacing-2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Primary View Area */
.primary-view-area {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-6);
    min-height: 500px;
}

.view-container {
    animation: fadeIn var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-6);
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-4);
}

.view-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Form Panel */
.form-panel {
    background: var(--md-sys-color-surface-container);
    border: 2px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-6);
    margin-bottom: var(--md-sys-spacing-6);
    animation: slideDown var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.form-panel.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-4);
}

.form-panel-header h3 {
    font-size: 1.25rem;
    color: var(--md-sys-color-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--md-sys-spacing-2);
    transition: all var(--md-sys-motion-duration-short);
}

.btn-close:hover {
    color: var(--md-sys-color-error);
    transform: scale(1.1);
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-4);
    gap: var(--md-sys-spacing-4);
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: var(--md-sys-spacing-2);
}

.filter-tabs .tab {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-tabs .tab:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-primary);
}

.filter-tabs .tab.active {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.sort-controls label {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.sort-controls select {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color var(--md-sys-motion-duration-short);
}

.sort-controls select:hover {
    border-color: var(--md-sys-color-primary);
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

/* ============================================
   ELEGANT MARKET TABLE (Futures/Discussions)
   ============================================ */
.discussion-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
}

.discussion-table thead {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(8, 145, 178, 0.15) 100%);
}

.discussion-table th {
    padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--md-sys-color-primary);
}

.discussion-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.discussion-table tbody tr:last-child {
    border-bottom: none;
}

.discussion-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, transparent 100%);
    transform: translateX(4px);
}

.discussion-table td {
    padding: var(--md-sys-spacing-4) var(--md-sys-spacing-5);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Future Type Cell */
.future-type {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-3);
}

.type-emoji {
    font-size: 1.75rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.type-name {
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-badge.status-listed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: var(--md-sys-color-success);
    border: 1px solid var(--md-sys-color-success);
}

.status-badge.status-unlisted {
    background: rgba(148, 163, 184, 0.1);
    color: var(--md-sys-color-on-surface-variant);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Timestamp */
.timestamp {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* Board Table */
.board-table-container {
    overflow-x: auto;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface);
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.board-table thead {
    background: var(--md-sys-color-surface-container);
    position: sticky;
    top: 0;
    z-index: 10;
}

.board-table th {
    padding: var(--md-sys-spacing-4);
    text-align: left;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    border-bottom: 2px solid var(--md-sys-color-outline);
    white-space: nowrap;
}

.board-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--md-sys-motion-duration-short);
}

.board-table th.sortable:hover {
    background: var(--md-sys-color-surface);
}

.sort-indicator {
    margin-left: var(--md-sys-spacing-1);
    color: var(--md-sys-color-primary);
}

.board-table tbody tr {
    border-bottom: 1px solid var(--md-sys-color-outline);
    transition: background var(--md-sys-motion-duration-short);
    cursor: pointer;
}

.board-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.board-table tbody tr:hover {
    background: var(--md-sys-color-surface-container);
}

.board-table td {
    padding: var(--md-sys-spacing-4);
    color: var(--md-sys-color-on-surface-variant);
}

/* Column Widths */
.col-subject {
    width: 30%;
}

.col-creator {
    width: 12%;
}

.col-pool {
    width: 12%;
}

.col-messages {
    width: 10%;
}

.col-activity {
    width: 15%;
}

.col-status {
    width: 10%;
}

.col-action {
    width: 11%;
}

/* Subject Cell */
.subject-cell {
    display: flex;
    align-items: center;
}

.subject-text {
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status Badge */
.status-badge {
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-2);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-inactive {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-terminated {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Action Button */
.btn-open-discussion {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-open-discussion:hover {
    background: var(--md-sys-color-primary-container);
    transform: translateX(2px);
}

/* Message Table */
.message-table-container {
    margin-top: var(--md-sys-spacing-4);
}

.message-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
}

.message-table thead {
    background: var(--md-sys-color-surface-container);
}

.message-table th {
    padding: var(--md-sys-spacing-3);
    text-align: left;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    border-bottom: 2px solid var(--md-sys-color-outline);
}

.message-table tbody tr {
    border-bottom: 1px solid var(--md-sys-color-outline);
    transition: background var(--md-sys-motion-duration-short);
}

.message-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.message-table tbody tr:hover {
    background: var(--md-sys-color-surface-container);
}

.message-table td {
    padding: var(--md-sys-spacing-3);
    color: var(--md-sys-color-on-surface-variant);
    vertical-align: top;
}

/* Message Table Columns */
.col-index {
    width: 5%;
    text-align: center;
    font-weight: 600;
    color: var(--md-sys-color-outline);
}

.col-author {
    width: 15%;
    white-space: nowrap;
}

.col-message {
    width: 37%;
}

.col-donation {
    width: 15%;
}

.col-time {
    width: 13%;
}

.col-support {
    width: 15%;
}

/* Message Content */
.message-content {
    line-height: 1.5;
}

.message-content.expandable .message-preview {
    display: inline;
}

.btn-expand-message,
.btn-collapse-message {
    margin-left: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-2);
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-expand-message:hover,
.btn-collapse-message:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.message-full {
    margin-top: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    white-space: pre-wrap;
}

.badge-you {
    margin-left: var(--md-sys-spacing-2);
    padding: 2px var(--md-sys-spacing-2);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.65rem;
    font-weight: 700;
}

/* Splash Button */
.btn-splash {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
    white-space: nowrap;
}

.btn-splash:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

/* Discussion Detail View */
.discussion-detail-view {
    animation: fadeIn var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.detail-nav {
    margin-bottom: var(--md-sys-spacing-4);
}

.btn-back {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-back:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-primary);
    transform: translateX(-2px);
}

/* Discussion Header */
.discussion-header {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-6);
    margin-bottom: var(--md-sys-spacing-6);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--md-sys-spacing-4);
    gap: var(--md-sys-spacing-4);
}

.discussion-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
}

.discussion-metadata {
    margin-bottom: var(--md-sys-spacing-4);
    padding-bottom: var(--md-sys-spacing-4);
    border-bottom: 1px solid var(--md-sys-color-outline);
}

.metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-4);
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.metadata-label {
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.btn-copy-inline,
.btn-etherscan-inline {
    padding: 2px 6px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-inline:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    transform: scale(1.1);
}

.btn-etherscan-inline:hover {
    background: var(--md-sys-color-secondary);
    color: white;
    transform: scale(1.1);
}

.metadata-full {
    color: var(--md-sys-color-outline);
    font-size: 0.75rem;
}

.discussion-description {
    margin-bottom: var(--md-sys-spacing-4);
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    line-height: 1.6;
}

.discussion-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--md-sys-spacing-3);
}

.stat-card {
    background: var(--md-sys-color-surface-variant);
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    text-align: center;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: var(--md-sys-spacing-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
}

/* Post Message Section */
.post-message-section {
    margin-bottom: var(--md-sys-spacing-6);
}

.messages-section {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-6);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--md-sys-spacing-4);
    color: var(--md-sys-color-on-surface);
}

/* Message Form */
.message-form {
    background: var(--md-sys-color-surface);
    padding: var(--md-sys-spacing-6);
    border-radius: var(--md-sys-shape-corner-medium);
}

.form-title {
    font-size: 1.25rem;
    margin-bottom: var(--md-sys-spacing-4);
    color: var(--md-sys-color-primary);
}

.form-group {
    margin-bottom: var(--md-sys-spacing-4);
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-2);
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.char-counter {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
}

.hint {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 400;
    margin-left: var(--md-sys-spacing-2);
}

.form-group textarea,
.form-group input[type="number"] {
    width: 100%;
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color var(--md-sys-motion-duration-short);
}

.form-group textarea:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-info {
    padding: var(--md-sys-spacing-3);
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--md-sys-shape-corner-small);
    margin-bottom: var(--md-sys-spacing-4);
    font-size: 0.875rem;
    line-height: 1.6;
}

.form-info .warning {
    color: var(--md-sys-color-warning);
    margin-top: var(--md-sys-spacing-2);
}

.note {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--md-sys-spacing-3);
}

.btn-submit {
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-submit:hover {
    background: var(--md-sys-color-primary-container);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

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

/* Info Panels */
.info-panel-container {
    margin-top: var(--md-sys-spacing-6);
}

.info-panel {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
}

.panel-summary {
    padding: var(--md-sys-spacing-4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-3);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--md-sys-color-on-surface);
    list-style: none;
    transition: background var(--md-sys-motion-duration-short);
}

.panel-summary:hover {
    background: var(--md-sys-color-surface-container);
}

.panel-icon {
    font-size: 1.5rem;
}

.panel-title {
    flex: 1;
}

.panel-arrow {
    transition: transform var(--md-sys-motion-duration-short);
}

details[open] .panel-arrow {
    transform: rotate(180deg);
}

.panel-content {
    padding: var(--md-sys-spacing-6);
    border-top: 1px solid var(--md-sys-color-outline);
}

/* Mechanics Panel */
.mechanics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--md-sys-spacing-6);
}

.mechanics-section h3 {
    font-size: 1.1rem;
    margin-bottom: var(--md-sys-spacing-3);
    color: var(--md-sys-color-primary);
}

.mechanics-section ul {
    list-style: none;
    padding: 0;
}

.mechanics-section li {
    padding: var(--md-sys-spacing-2) 0;
    line-height: 1.6;
    font-size: 0.875rem;
}

.mechanics-section li strong {
    color: var(--md-sys-color-on-surface);
}

.quick-reference {
    margin-top: var(--md-sys-spacing-6);
    padding-top: var(--md-sys-spacing-6);
    border-top: 2px solid var(--md-sys-color-outline);
}

.quick-reference h3 {
    font-size: 1.1rem;
    margin-bottom: var(--md-sys-spacing-4);
    color: var(--md-sys-color-primary);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-3);
}

.reference-item {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
}

.reference-item strong {
    color: var(--md-sys-color-on-surface);
    display: block;
    margin-bottom: var(--md-sys-spacing-1);
}

/* Technical Panel */
.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--md-sys-spacing-6);
}

.contract-section h3 {
    font-size: 1.1rem;
    margin-bottom: var(--md-sys-spacing-3);
    color: var(--md-sys-color-primary);
}

.contract-info {
    background: var(--md-sys-color-surface);
    padding: var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-small);
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    margin-bottom: var(--md-sys-spacing-3);
    font-size: 0.875rem;
}

.info-label {
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.info-value {
    color: var(--md-sys-color-on-surface);
}

.info-value.address {
    font-family: monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.btn-copy {
    padding: var(--md-sys-spacing-1);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform var(--md-sys-motion-duration-short);
}

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

.info-links {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    margin-top: var(--md-sys-spacing-3);
}

.btn-link {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    text-decoration: none;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
    display: inline-block;
}

.btn-link:hover {
    background: var(--md-sys-color-primary-container);
}

.tech-info,
.features-list {
    background: var(--md-sys-color-surface);
    padding: var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-small);
}

.tech-item,
.feature-item {
    padding: var(--md-sys-spacing-2) 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.feature-check {
    color: var(--md-sys-color-success);
    font-weight: bold;
}

/* ABI Viewer */
.abi-viewer {
    margin-top: var(--md-sys-spacing-6);
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    animation: slideDown var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.abi-viewer.hidden {
    display: none;
}

.abi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-3);
}

.abi-header h4 {
    color: var(--md-sys-color-primary);
}

.abi-content {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.75rem;
    line-height: 1.4;
}

.abi-content code {
    color: var(--md-sys-color-on-surface);
}

.btn-copy-abi {
    margin-top: var(--md-sys-spacing-3);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-copy-abi:hover {
    background: var(--md-sys-color-primary-container);
}

/* Loading & Empty States */
.loading-state,
.empty-state,
.error-state {
    padding: var(--md-sys-spacing-12);
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--md-sys-spacing-4);
    opacity: 0.5;
}

.empty-state p,
.error-state p {
    font-size: 1rem;
    margin-top: var(--md-sys-spacing-3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .board-table-container {
        font-size: 0.8rem;
    }

    .col-subject {
        width: 25%;
    }

    .col-message {
        width: 35%;
    }
}

@media (max-width: 768px) {
    .primary-view-area {
        padding: var(--md-sys-spacing-4);
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }

    .board-table {
        font-size: 0.75rem;
    }

    .board-table th,
    .board-table td {
        padding: var(--md-sys-spacing-2);
    }

    /* Hide some columns on mobile */
    .col-creator,
    .col-activity {
        display: none;
    }

    .discussion-header {
        padding: var(--md-sys-spacing-4);
    }

    .header-top {
        flex-direction: column;
    }

    .discussion-title {
        font-size: 1.5rem;
    }

    .discussion-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .message-table {
        font-size: 0.75rem;
    }

    .message-table th,
    .message-table td {
        padding: var(--md-sys-spacing-2);
    }

    .col-time {
        display: none;
    }

    .mechanics-grid,
    .technical-grid {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn-primary {
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

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

.btn-secondary {
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short);
}

.btn-secondary:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-primary);
}

/* Advanced Config */
.advanced-config {
    margin-bottom: var(--md-sys-spacing-4);
    padding: var(--md-sys-spacing-4);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--md-sys-shape-corner-medium);
    border: 2px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
}

.advanced-config summary {
    font-weight: 600;
    padding: var(--md-sys-spacing-2);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.advanced-config summary span:first-child {
    transition: transform var(--md-sys-motion-duration-short);
}

.advanced-config[open] summary span:first-child {
    transform: rotate(90deg);
}

.advanced-config-content {
    margin-top: var(--md-sys-spacing-3);
    padding-top: var(--md-sys-spacing-3);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-3);
    margin-bottom: var(--md-sys-spacing-3);
}

/* Discussion Form */
.discussion-form {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-4);
}

.discussion-form input[type="text"],
.discussion-form input[type="number"],
.discussion-form textarea {
    width: 100%;
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--md-sys-motion-duration-short);
}

.discussion-form input:focus,
.discussion-form textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.discussion-form textarea {
    resize: vertical;
    min-height: 100px;
}

.value-warning {
    font-size: 0.875rem;
    color: var(--md-sys-color-warning);
    margin-top: var(--md-sys-spacing-2);
}

/* ============================================
   FUTURES MARKETPLACE STYLES
   ============================================ */

/* Future Type Display */
.future-type {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.type-emoji {
    font-size: 1.5rem;
}

.type-name {
    font-weight: 500;
}

.future-type-large {
    display: flex;
    align-items: flex-start;
    gap: var(--md-sys-spacing-3);
}

.type-emoji-large {
    font-size: 3rem;
}

.type-description {
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--md-sys-spacing-1);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-2);
    border-radius: var(--md-sys-shape-corner-small);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-listed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-unlisted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--md-sys-color-outline);
}

.status-listed-large {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    font-size: 1rem;
}

/* Time Left Display */
.time-left {
    font-family: 'Courier New', monospace;
}

/* Expected Value */
.expected-value {
    color: var(--md-sys-color-primary);
    font-weight: 600;
}

/* Future Detail View */
.future-detail-view {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-4);
}

.info-card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--md-sys-spacing-4);
    padding-bottom: var(--md-sys-spacing-4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* Progress Section */
.progress-section {
    margin: var(--md-sys-spacing-4) 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--md-sys-spacing-2);
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
    transition: width var(--md-sys-motion-duration-medium);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--md-sys-spacing-2);
    font-size: 0.75rem;
    color: var(--md-sys-color-outline);
}

/* Chart Section */
.chart-section {
    margin: var(--md-sys-spacing-4) 0;
}

.chart-section h4 {
    margin-bottom: var(--md-sys-spacing-3);
    color: var(--md-sys-color-on-surface);
}

.chart-section canvas {
    max-height: 300px;
}

/* Contract Info */
.contract-info {
    margin-top: var(--md-sys-spacing-4);
    padding-top: var(--md-sys-spacing-4);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--md-sys-spacing-2) 0;
    font-size: 0.875rem;
}

.info-row .label {
    color: var(--md-sys-color-on-surface-variant);
}

.info-row .value {
    color: var(--md-sys-color-on-surface);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Action Section */
.action-section {
    margin-top: var(--md-sys-spacing-4);
    padding-top: var(--md-sys-spacing-4);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    gap: var(--md-sys-spacing-3);
}

/* Buy Section */
.buy-section {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
    width: 100%;
}

.buy-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
}

.buy-price .price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--md-sys-color-primary);
}

/* Distribution Chart Preview */
.valuation-preview {
    margin-top: var(--md-sys-spacing-3);
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
}

#distribution-chart {
    max-height: 250px;
}

/* Form Hint */
.form-hint {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--md-sys-spacing-1);
}

/* Distribution Select */
#distribution-type {
    width: 100%;
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface);
    border: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--md-sys-motion-duration-short);
}

#distribution-type:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

/* Lifetime Slider */
#lifetime {
    width: 100%;
    height: 8px;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-small);
    outline: none;
    -webkit-appearance: none;
}

#lifetime::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    border-radius: 50%;
}

#lifetime::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* ============================================
   FUTURES PAGE HEADER
   ============================================ */
.futures-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-6) var(--md-sys-spacing-8);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(8, 145, 178, 0.1) 100%);
    border-radius: var(--md-sys-shape-corner-large);
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin-bottom: var(--md-sys-spacing-6);
}

.futures-header-content {
    flex: 1;
}

.futures-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-2) 0;
    letter-spacing: -0.02em;
}

.futures-subtitle {
    font-size: 1rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.btn-large {
    padding: var(--md-sys-spacing-4) var(--md-sys-spacing-6);
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ============================================
   INFO SECTIONS
   ============================================ */
.info-section {
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-6);
    margin-top: var(--md-sys-spacing-6);
}

.section-header {
    margin-bottom: var(--md-sys-spacing-5);
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-2) 0;
}

.section-subtitle {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.95rem;
    margin: 0;
}

/* ============================================
   DIRECT TRANSFER TOOL
   ============================================ */
.transfer-tool-panel {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-5);
}

.transfer-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--md-sys-spacing-4);
    align-items: end;
}

.transfer-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
}

.transfer-form .form-group-button {
    margin-bottom: 0;
}

.transfer-form label {
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    font-size: 0.9rem;
}

.transfer-form input {
    padding: var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    font-family: monospace;
    font-size: 0.95rem;
}

.transfer-form input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--md-sys-spacing-5);
    margin-bottom: var(--md-sys-spacing-6);
}

.work-step {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-5);
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-on-primary);
    margin-bottom: var(--md-sys-spacing-3);
}

.work-step h4 {
    font-size: 1.2rem;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-2) 0;
}

.work-step p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* KEY FEATURES */
.key-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--md-sys-spacing-4);
    padding: var(--md-sys-spacing-5);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
}

.feature {
    display: flex;
    gap: var(--md-sys-spacing-3);
    align-items: start;
}

.feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature strong {
    display: block;
    color: var(--md-sys-color-on-surface);
    font-size: 0.95rem;
    margin-bottom: var(--md-sys-spacing-1);
}

.feature p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.85rem;
    margin: 0;
}

/* ============================================
   TECHNICAL DETAILS SECTION
   ============================================ */
.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--md-sys-spacing-5);
    margin-bottom: var(--md-sys-spacing-5);
}

.technical-item {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-5);
}

.technical-item h4 {
    font-size: 1.1rem;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-3) 0;
    border-bottom: 2px solid var(--md-sys-color-primary);
    padding-bottom: var(--md-sys-spacing-2);
}

.technical-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.technical-item li {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.8;
    padding-left: var(--md-sys-spacing-3);
    position: relative;
}

.technical-item li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--md-sys-color-primary);
}

.technical-item p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: var(--md-sys-spacing-2) 0;
}

.technical-item code {
    display: block;
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    padding: var(--md-sys-spacing-3);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--md-sys-color-secondary);
    margin: var(--md-sys-spacing-3) 0;
    overflow-x: auto;
}

/* CONTRACT LINKS */
.contract-links {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-5);
}

.contract-links h4 {
    font-size: 1.1rem;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--md-sys-spacing-3) 0;
}

.link-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--md-sys-spacing-3);
}

.contract-link {
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.contract-link:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
    transform: translateY(-2px);
}

/* Responsive Adjustments for Futures */
@media (max-width: 768px) {
    .futures-page-header {
        flex-direction: column;
        gap: var(--md-sys-spacing-4);
        padding: var(--md-sys-spacing-5);
    }
    
    .futures-title {
        font-size: 1.5rem;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .transfer-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .how-it-works-grid {
        grid-template-columns: 1fr;
    }
    
    .key-features {
        grid-template-columns: 1fr;
    }
    
    .technical-grid {
        grid-template-columns: 1fr;
    }
    
    .future-type-large {
        flex-direction: column;
    }
    
    .type-emoji-large {
        font-size: 2rem;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .info-row {
        flex-direction: column;
        gap: var(--md-sys-spacing-1);
    }
}

/* ============================================================================
   VIEW LOADER - Loading indicators for dynamic imports
   ============================================================================ */

/* Main view loader - full container loading state */
.view-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--md-sys-spacing-4);
    padding: var(--md-sys-spacing-6);
}

/* Spinner animation */
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Loader message */
.loader-message {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    margin: 0;
}

/* Inline loader - for smaller UI elements */
.loader-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    margin-left: var(--md-sys-spacing-2);
}

.loader-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Loading overlay - for existing content */
.view-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .view-loader-overlay {
        background: rgba(0, 0, 0, 0.85);
    }
}

/* ============================================================================
   ABOUT PAGE - Project vision and technical details
   ============================================================================ */

/* About Content Container */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--md-sys-spacing-6);
}

/* Hero Section */
.about-hero {
    text-align: center;
    padding: var(--md-sys-spacing-8) var(--md-sys-spacing-4);
    background: linear-gradient(135deg, 
        var(--md-sys-color-primary-container) 0%, 
        var(--md-sys-color-tertiary-container) 100%);
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin-bottom: var(--md-sys-spacing-8);
}

.about-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 var(--md-sys-spacing-4) 0;
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--md-sys-color-on-primary-container);
    margin: 0;
    opacity: 0.9;
}

/* Section Styling */
.about-section {
    margin-bottom: var(--md-sys-spacing-8);
}

.about-section h2 {
    font-size: 2rem;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-4);
    border-bottom: 2px solid var(--md-sys-color-primary);
    padding-bottom: var(--md-sys-spacing-2);
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: var(--md-sys-spacing-4);
}

.about-section code {
    background: var(--md-sys-color-surface-variant);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

/* Faucet Section */
.faucet-section {
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.1) 0%, 
        rgba(59, 130, 246, 0.1) 100%);
    border-radius: var(--md-sys-shape-corner-large);
    padding: var(--md-sys-spacing-8);
}

.faucet-panel {
    text-align: center;
}

.faucet-panel h2 {
    font-size: 2.2rem;
    margin-bottom: var(--md-sys-spacing-4);
    color: #10b981;
    border: none;
}

.faucet-message {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: var(--md-sys-spacing-6);
    color: var(--md-sys-color-on-surface);
}

.btn-faucet {
    display: inline-block;
    padding: var(--md-sys-spacing-4) var(--md-sys-spacing-8);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-faucet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

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

/* Card Grids */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--md-sys-spacing-5);
    margin-top: var(--md-sys-spacing-5);
}

.about-card {
    background: var(--md-sys-color-surface-variant);
    padding: var(--md-sys-spacing-5);
    border-radius: var(--md-sys-shape-corner-large);
    border-left: 4px solid var(--md-sys-color-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.about-card h3 {
    margin: 0 0 var(--md-sys-spacing-3) 0;
    font-size: 1.3rem;
    color: var(--md-sys-color-on-surface);
}

.about-card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-5);
}

.stack-layer {
    display: flex;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
}

.stack-label {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    padding: var(--md-sys-spacing-4);
    min-width: 180px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.stack-content {
    padding: var(--md-sys-spacing-4);
    flex: 1;
    color: var(--md-sys-color-on-surface);
}

.stack-content strong {
    color: var(--md-sys-color-primary);
}

/* Why This Matters Grid */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--md-sys-spacing-4);
    margin-top: var(--md-sys-spacing-5);
}

.why-item {
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    border-top: 3px solid var(--md-sys-color-tertiary);
}

.why-item h4 {
    margin: 0 0 var(--md-sys-spacing-2) 0;
    color: var(--md-sys-color-tertiary);
    font-size: 1.2rem;
}

.why-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Vision Section */
.about-vision {
    background: linear-gradient(135deg, 
        var(--md-sys-color-tertiary-container) 0%,
        var(--md-sys-color-secondary-container) 100%);
    padding: var(--md-sys-spacing-6);
    border-radius: var(--md-sys-shape-corner-extra-large);
    margin-top: var(--md-sys-spacing-8);
}

.about-vision h2 {
    border-bottom: none;
    color: var(--md-sys-color-on-tertiary-container);
}

.vision-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--md-sys-color-on-tertiary-container);
}

.vision-text strong {
    font-size: 1.3rem;
    color: var(--md-sys-color-tertiary);
    display: block;
    margin-top: var(--md-sys-spacing-4);
}

/* Global Footer - Appears on all pages */
.global-footer {
    text-align: center;
    padding: var(--md-sys-spacing-5) var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin-top: auto;
}

.global-footer p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .about-content {
        padding: var(--md-sys-spacing-4);
    }
    
    .about-hero {
        padding: var(--md-sys-spacing-6) var(--md-sys-spacing-4);
    }
    
    .about-hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .about-section p {
        font-size: 1rem;
    }
    
    .faucet-section {
        padding: var(--md-sys-spacing-5);
    }
    
    .faucet-panel h2 {
        font-size: 1.6rem;
    }
    
    .faucet-message {
        font-size: 1rem;
    }
    
    .btn-faucet {
        padding: var(--md-sys-spacing-3) var(--md-sys-spacing-6);
        font-size: 1rem;
        width: 100%;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-stack {
        gap: var(--md-sys-spacing-2);
    }
    
    .stack-layer {
        flex-direction: column;
    }
    
    .stack-label {
        min-width: 100%;
    }
    
    .why-grid {
        grid-template-columns: 1fr;
    }
    
    .vision-text {
        font-size: 1rem;
    }
}

/* ============================================================================
   SIMPLIFIED FILTERS - Toggle-based filtering
   ============================================================================ */

/* Filter Toggle (Checkbox style) */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface);
    user-select: none;
}

.filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--md-sys-color-primary);
}

.filter-toggle:hover {
    color: var(--md-sys-color-primary);
}

/* Filter Controls Group */
.filter-controls-group {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-5);
    flex-wrap: wrap;
}

.filter-select {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    font-size: 0.9rem;
}

.filter-select label {
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.filter-select select {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select select:hover {
    border-color: var(--md-sys-color-primary);
}

.filter-select select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px rgba(var(--md-sys-color-primary-rgb), 0.1);
}

/* Update table controls layout */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-4);
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    margin-bottom: var(--md-sys-spacing-4);
    gap: var(--md-sys-spacing-4);
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-controls-group {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--md-sys-spacing-3);
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .filter-select select {
        flex: 1;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =============================================================================
   3D Dice Component Styles
   ============================================================================= */

.dice-scene {
    width: 100%;
    height: 240px;
    margin: 0 auto;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 12px;
    position: relative;
    overflow: visible;
}

.die-cube {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.die-face {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    backface-visibility: visible;
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.3);
}

.die-face.selected {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.4),
        0 8px 32px rgba(255, 255, 255, 0.3),
        0 0 40px currentColor;
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            inset 0 0 20px rgba(255, 255, 255, 0.4),
            0 8px 32px rgba(255, 255, 255, 0.3),
            0 0 40px currentColor;
    }
    50% {
        box-shadow: 
            inset 0 0 30px rgba(255, 255, 255, 0.6),
            0 8px 40px rgba(255, 255, 255, 0.5),
            0 0 60px currentColor;
    }
}

/* Face positioning in 3D space */
.die-face-1 {
    transform: rotateY(90deg) translateZ(60px);
}

.die-face-2 {
    transform: rotateY(-90deg) translateZ(60px);
}

.die-face-3 {
    transform: rotateX(90deg) translateZ(60px);
}

.die-face-4 {
    transform: rotateX(-90deg) translateZ(60px);
}

.die-face-5 {
    transform: rotateY(0deg) translateZ(60px);
}

.die-face-6 {
    transform: rotateY(180deg) translateZ(60px);
}

/* Die face content - dots */
.die-face-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 15px;
}

.die-dot {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Dot patterns */
.dot-center {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Two dots - opposite corners (top-left, bottom-right) */
.dot-two-opposite {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.dot-two-opposite .die-dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
}

.dot-two-opposite .die-dot:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: end;
}

/* Three dots - diagonal line (top-left, center, bottom-right) */
.dot-three-diagonal {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.dot-three-diagonal .die-dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
}

.dot-three-diagonal .die-dot:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: center;
}

.dot-three-diagonal .die-dot:nth-child(3) {
    grid-column: 3;
    grid-row: 3;
    align-self: end;
    justify-self: end;
}

/* Four dots - corners */
.dot-four-corners {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.dot-four-corners .die-dot:nth-child(1) {
    align-self: start;
    justify-self: start;
}

.dot-four-corners .die-dot:nth-child(2) {
    align-self: start;
    justify-self: end;
}

.dot-four-corners .die-dot:nth-child(3) {
    align-self: end;
    justify-self: start;
}

.dot-four-corners .die-dot:nth-child(4) {
    align-self: end;
    justify-self: end;
}

/* Five dots - quincunx pattern (four corners + center) */
.dot-five-quincunx {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.dot-five-quincunx .die-dot:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
}

.dot-five-quincunx .die-dot:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
}

.dot-five-quincunx .die-dot:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: center;
}

.dot-five-quincunx .die-dot:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    justify-self: start;
}

.dot-five-quincunx .die-dot:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
    align-self: end;
    justify-self: end;
}

/* Six dots - two columns of three */
.dot-six-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    width: 100%;
    height: 100%;
    padding: 10px;
    gap: 10px;
}

.dot-six-columns .die-dot {
    margin: auto;
}

/* Number Select */
.dice-number-select {
    margin-top: 0.5rem;
    text-align: center;
}

.dice-number-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin: 0 auto;
}

.dice-number-btn {
    width: 100%;
    min-width: 45px;
    height: 45px;
    border: 2px solid rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    color: #8b5cf6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dice-number-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(124, 58, 237, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.dice-number-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: rgba(139, 92, 246, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.dice-number-btn:hover::before {
    opacity: 1;
}

.dice-number-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

/* Instructions */
.dice-instructions {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.4rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.dice-instruction-text {
    color: #8b5cf6;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Fix for value input dropdown overflow in compact layouts */
.contest-info-panel {
    overflow: visible !important;
}

.value-input-container {
    position: relative;
    overflow: visible !important;
}

.value-input-component {
    overflow: visible !important;
}

.value-input-header {
    overflow: visible !important;
    flex-wrap: nowrap;
}

.unit-toggle {
    overflow: visible !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.unit-btn {
    min-width: fit-content;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dice-scene {
        height: 200px;
    }
    
    .die-cube {
        width: 90px;
        height: 90px;
    }
    
    .die-face {
        width: 90px;
        height: 90px;
        border-width: 2px;
    }
    
    .die-face-1,
    .die-face-2,
    .die-face-3,
    .die-face-4,
    .die-face-5,
    .die-face-6 {
        transform: rotateY(var(--face-rotate-y, 0deg)) rotateX(var(--face-rotate-x, 0deg)) translateZ(45px);
    }
    
    .die-face-1 { --face-rotate-y: -90deg; }
    .die-face-2 { --face-rotate-y: 90deg; }
    .die-face-3 { --face-rotate-x: -90deg; }
    .die-face-4 { --face-rotate-x: 90deg; }
    .die-face-5 { --face-rotate-y: 0deg; }
    .die-face-6 { --face-rotate-y: 180deg; }
    
    .die-dot {
        width: 12px;
        height: 12px;
    }
    
    .dice-number-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.4rem;
    }
    
    .dice-number-btn {
        min-width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    /* Stack game layout on mobile */
    .game-sections > .contest-info-panel > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ============================================
   3D BAR GRAPH COMPONENT
   ============================================ */

/* Bar Graph Scene Container */
.bar-graph-scene {
    perspective: 1200px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
}

/* Bars Container - 3D space */
.bars-container {
    transform-style: preserve-3d;
}

/* Individual 3D Bar */
.bar-3d {
    transform-style: preserve-3d;
    will-change: transform;
}

.bar-inner {
    transform-style: preserve-3d;
}

/* Bar faces */
.bar-face {
    backface-visibility: hidden;
}

.bar-front {
    transform: translateZ(20px);
}

.bar-top {
    transform: rotateX(90deg) translateZ(20px);
    transform-origin: top center;
}

.bar-right {
    transform: rotateY(90deg) translateZ(20px);
    transform-origin: center right;
}

/* Bar hover effect enhancements */
.bar-3d:hover {
    z-index: 100;
}

.bar-3d:hover .bar-front {
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 2px 6px rgba(255,255,255,0.3) !important;
}

/* Bar value and label animations */
.bar-value {
    animation: fadeInScale 0.4s ease-out;
}

.bar-label-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Graph legend styling */
.graph-legend {
    user-select: none;
}

/* Responsive adjustments for bar graph */
@media (max-width: 768px) {
    .bar-graph-scene {
        height: 250px !important;
        perspective: 800px;
    }
    
    .bar-3d {
        min-width: 30px !important;
        max-width: 50px !important;
    }
    
    .bar-value {
        font-size: 0.65rem !important;
    }
    
    .bar-label {
        font-size: 0.55rem !important;
    }
}

/* ============================================
   LAZY SUSAN 3D COMPONENT
   ============================================ */

/* Scene Container */
.lazy-susan-scene {
    width: 100%;
    height: 300px;
    margin: 0 auto;
    perspective: 1200px;
    perspective-origin: 50% 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 16px;
    overflow: visible;
}

/* Rotating Platform */
.lazy-susan-platform {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    transform: rotateX(-15deg) rotateY(0deg);
}

/* Pentagram Base */
.lazy-susan-pentagram {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(-20px) rotateX(90deg);
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.6));
    animation: pentagram-pulse 3s ease-in-out infinite;
}

@keyframes pentagram-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.9));
    }
}

/* Fire Emoji at Center */
.lazy-susan-fire {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(5px);
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(255, 100, 0, 0.8));
    pointer-events: none;
}

/* Individual Items on the Lazy Susan */
.lazy-susan-item {
    position: absolute;
    width: 100px;
    height: 140px;
    top: 50%;
    left: 50%;
    margin-left: -50px;
    margin-top: -70px;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lazy-susan-item-content {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    transform: rotateY(0deg);
    backface-visibility: hidden;
    transition: all 0.3s ease;
}

.lazy-susan-item:hover .lazy-susan-item-content {
    transform: translateZ(20px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.4),
        inset 0 2px 12px rgba(255, 255, 255, 0.2);
}

.lazy-susan-item.selected .lazy-susan-item-content {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.4),
        0 12px 48px rgba(255, 255, 255, 0.4),
        0 0 60px var(--item-color, currentColor);
    animation: pulse-glow-lazy 1.5s ease-in-out infinite;
    transform: translateZ(30px) scale(1.1);
}

@keyframes pulse-glow-lazy {
    0%, 100% {
        box-shadow: 
            inset 0 0 20px rgba(255, 255, 255, 0.4),
            0 12px 48px rgba(255, 255, 255, 0.4),
            0 0 60px var(--item-color, currentColor);
    }
    50% {
        box-shadow: 
            inset 0 0 30px rgba(255, 255, 255, 0.6),
            0 12px 56px rgba(255, 255, 255, 0.5),
            0 0 80px var(--item-color, currentColor);
    }
}

.lazy-susan-emoji {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.lazy-susan-name {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.lazy-susan-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Arrow Controls */
.lazy-susan-controls {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.lazy-susan-arrow {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lazy-susan-arrow:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.lazy-susan-arrow:active {
    transform: scale(0.95);
}

.lazy-susan-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    background: linear-gradient(135deg, #ef4444dd 0%, #ef4444aa 100%);
}

.lazy-susan-select-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.lazy-susan-select-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lazy-susan-scene {
        height: 250px;
    }
    
    .lazy-susan-platform {
        width: 160px;
        height: 160px;
    }
    
    .lazy-susan-pentagram svg {
        width: 140px;
        height: 140px;
    }
    
    .lazy-susan-fire {
        font-size: 3rem;
    }
    
    .lazy-susan-item {
        width: 80px;
        height: 110px;
        margin-left: -40px;
        margin-top: -55px;
    }
    
    .lazy-susan-emoji {
        font-size: 2.5rem;
    }
    
    .lazy-susan-name {
        font-size: 0.85rem;
    }
    
    .lazy-susan-subtitle {
        font-size: 0.6rem;
    }
    
    .lazy-susan-arrow {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .lazy-susan-select-btn {
        padding: 0.75rem 1.5rem;
        min-width: 140px;
    }
    
    .lazy-susan-controls {
        gap: 0.75rem;
    }
}

/* ============================================================================
   UPLOADS VIEW
   ============================================================================ */

.upload-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin: 0 auto;
}

.upload-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.upload-type-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.upload-type-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.upload-type-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.upload-section-content {
    margin-bottom: 2rem;
}

.upload-info {
    margin-bottom: 1.5rem;
    text-align: center;
}

.upload-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.upload-info p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-input-group {
    margin-bottom: 1.5rem;
}

.file-upload-label {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.file-upload-label:hover {
    background: var(--accent-color);
}

.file-input {
    display: none;
}

.image-preview {
    margin-top: 1.5rem;
    text-align: center;
}

.image-preview canvas {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #000;
}

.text-upload-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
}

.text-upload-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.text-counter {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.upload-submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.upload-cost-info {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.upload-cost-info p {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.upload-cost-info ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.upload-cost-info li {
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

/* Content Browser */
.content-browser-section {
    max-width: 1000px;
    margin: 2rem auto;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.browser-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-entry {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.content-entry:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.content-entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.content-type {
    font-weight: bold;
    color: var(--primary-color);
}

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

.content-entry-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.content-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.content-link:hover {
    background: var(--accent-color);
}

.view-toggle {
    text-align: center;
    margin-top: 2rem;
}

/* Content Detail View */
.content-detail-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--border-color);
}

.content-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.content-detail-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.content-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.content-detail-meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-detail-meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
}

.content-detail-body {
    margin-top: 2rem;
}

.content-detail-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.content-detail-preview canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
}

.content-detail-text {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
}

.content-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.content-detail-actions .btn-secondary {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-panel {
        padding: 1.5rem;
    }
    
    .upload-type-selector {
        flex-direction: column;
    }
}

/* ============================================
   COMPRESSION MODE SELECTOR
   ============================================ */

.compression-mode-selector {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.compression-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.compression-mode-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compression-mode-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.compression-mode-card.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: #667eea;
    border-width: 3px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5), inset 0 0 20px rgba(102, 126, 234, 0.1);
}

.compression-mode-card.selected::before {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-name {
    font-weight: bold;
    color: white;
    font-size: 1rem;
}

.mode-capacity {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.mode-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.mode-size {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-size .gain {
    color: #10b981;
    font-weight: bold;
}

.mode-suggestion {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive grid */
@media (max-width: 768px) {
    .compression-modes {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .compression-modes {
        grid-template-columns: repeat(2, 1fr);
    }
}

