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

:root {
    --bg: #0A0A0B;
    --bg-secondary: #141416;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --surface-glass: rgba(255, 255, 255, 0.03);
    --text: #FFFFFF;
    --text-secondary: #7d7d91;
    --text-tertiary: #6B6B73;
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.06);
    --accent-primary: #656578;
    --accent-primary-hover: #74747d;
    --accent-danger: #FF453A;
    --success: #30D158;
    --warning: #FF9F0A;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    
    --spacing: 20px;
    --spacing-sm: 16px;
    --spacing-lg: 28px;
    --spacing-xl: 40px;
    --spacing-2xl: 60px;
    
    --backdrop-blur: blur(20px);
    --backdrop-blur-sm: blur(10px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(10, 132, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 69, 58, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(48, 209, 88, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    min-height: 100vh;
    padding: var(--spacing-lg) var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    overflow: hidden;
}

.header-tabs {
    display: flex;
    gap: 8px;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-xl);
}

.tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex: 1;
    text-align: center;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--text);
    background: var(--surface);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    box-shadow: var(--shadow-sm), var(--shadow-glass);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    overflow: hidden;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    align-items: start;
    min-height: calc(100vh - 200px);
    max-width: 100%;
    overflow: hidden;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md), var(--shadow-glass);
    height: fit-content;
}

.input-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 50px;
}

.input-field {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    color: var(--text);
    font-weight: 400;
    transition: all 0.2s ease;
}

.input-field::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.weight-input {
    flex: 0 0 90px;
    min-width: 90px;
    text-align: center;
}

.input-group .btn-primary {
    flex: 0 0 auto;
    min-width: 80px;
    white-space: nowrap;
}

.input-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.search-box {
    margin-top: 4px;
}

.btn {
    padding: 14px 24px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text);
    border-color: var(--accent-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary.btn-editing {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--text);
}

.btn-primary.btn-editing:hover:not(:disabled) {
    background: #FFB347;
    border-color: #FFB347;
}

.btn-spin {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    margin-top: var(--spacing-lg);
    letter-spacing: 0.3px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: var(--text);
    border: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn-spin:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-primary-hover), var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.items-list {
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing);
    min-height: 240px;
    max-height: 500px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 80px 20px;
    font-size: 15px;
    font-weight: 300;
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 0 -16px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item:hover {
    background: var(--surface-hover);
}

.item-text {
    flex: 1;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.item-text:hover {
    background: rgba(0, 122, 255, 0.06);
}

.item-weight {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.item-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.item-delete:hover {
    color: var(--accent-danger);
    background: rgba(255, 59, 48, 0.1);
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md), var(--shadow-glass);
}

.wheel-container {
    position: relative;
    width: 420px;
    height: 420px;
    margin-bottom: 36px;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 26px solid var(--text);
    z-index: 10;
    margin-top: -210px;
    margin-left: -1px;
}

.result-display {
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1.5px solid var(--border);
    padding: var(--spacing-xl) var(--spacing-lg);
    border-radius: var(--radius);
    min-width: 320px;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-md), var(--shadow-glass);
}

.result-text {
    font-size: 22px;
    font-weight: 600;
    min-height: 32px;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.result-text.winner {
    color: var(--accent-primary);
    font-weight: 700;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

.spin-controls {
    width: 100%;
}

.spin-settings {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
}

.speed-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.speed-buttons {
    display: flex;
    gap: 8px;
}

.speed-btn {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.speed-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent-primary);
    color: var(--text);
    transform: translateY(-1px);
}

.speed-btn.active {
    background: var(--accent-primary);
    color: var(--surface);
    border-color: var(--accent-primary);
    font-weight: 600;
}

.history-section,
.stats-section {
    padding: var(--spacing-xl);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md), var(--shadow-glass);
}

h2 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
    line-height: 1.2;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing);
    margin-bottom: var(--spacing-lg);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    padding: var(--spacing-lg);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing);
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--surface-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.history-item-text {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

.history-item-time {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

.history-item-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    display: inline-block;
    width: fit-content;
}

.history-item-percentage {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 300;
}

.history-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    opacity: 0.6;
}

.history-delete:hover {
    color: var(--accent-danger);
    background: rgba(255, 59, 48, 0.1);
    opacity: 1;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing);
    margin-bottom: var(--spacing-xl);
}

.overview-card {
    padding: var(--spacing-lg);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.overview-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.overview-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}

.overview-value-small {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.stats-details {
    margin-top: var(--spacing-xl);
}

.stats-details h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.3px;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 600px;
    overflow-y: auto;
}

.stat-card {
    padding: var(--spacing-lg);
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing);
}

.stat-card-name {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
}

.stat-card-rank {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    min-width: 32px;
    text-align: center;
}

.stat-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing);
}

.stat-card-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-card-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.stat-card-percentage {
    font-size: 16px;
    color: var(--accent-primary);
    font-weight: 600;
}

.stat-card-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.stat-card-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.modal-body {
    padding: var(--spacing-xl);
}

.textarea-field {
    width: 100%;
    min-height: 220px;
    padding: var(--spacing);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface-glass);
    backdrop-filter: var(--backdrop-blur-sm);
    -webkit-backdrop-filter: var(--backdrop-blur-sm);
    color: var(--text);
    resize: vertical;
    margin-bottom: var(--spacing-lg);
}

.textarea-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.items-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 8px;
}

.items-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.items-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.items-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

@media (max-width: 968px) and (min-width: 769px) {
    .container {
        padding: var(--spacing-lg) var(--spacing);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .wheel-container {
        width: 380px;
        height: 380px;
    }
    
    .wheel-pointer {
        margin-top: -190px;
    }

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

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .wheel-container {
        width: 340px;
        height: 340px;
    }
    
    .wheel-pointer {
        margin-top: -170px;
    }

    .input-actions {
        grid-template-columns: 1fr;
    }

    .input-actions .btn {
        width: 100%;
    }
    
    .input-section,
    .wheel-section,
    .history-section,
    .stats-section {
        padding: var(--spacing-lg);
    }
    
    h1 {
        font-size: 32px;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .container {
        padding: var(--spacing) var(--spacing-sm);
    }
    
    .wheel-container {
        width: min(300px, 90vw);
        height: min(300px, 90vw);
    }
    
    .wheel-pointer {
        margin-top: calc(min(300px, 90vw) / -2);
    }
    
    .input-group {
        flex-direction: column;
    }

    .weight-input {
        flex: 1;
        width: 100%;
    }
    
    .input-group .btn-primary {
        width: 100%;
        margin-top: var(--spacing-sm);
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
        letter-spacing: -0.5px;
    }
    
    .input-section,
    .wheel-section,
    .history-section,
    .stats-section {
        padding: var(--spacing);
        border-radius: var(--radius-sm);
    }
    
    .header-tabs {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .tab {
        width: 100%;
    }
    
    .result-display {
        min-width: auto;
        width: 100%;
        padding: var(--spacing-lg) var(--spacing);
    }
    
    .btn-spin {
        padding: 16px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .input-field {
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .speed-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    .wheel-container {
        width: min(280px, 85vw);
        height: min(280px, 85vw);
    }
    
    .wheel-pointer {
        margin-top: calc(min(280px, 85vw) / -2);
    }
    
    h1 {
        font-size: 24px;
    }
    
    .input-section,
    .wheel-section,
    .history-section,
    .stats-section {
        padding: var(--spacing-sm);
    }
    
    
    .history-item,
    .stat-card {
        padding: var(--spacing);
    }
    
    .result-text {
        font-size: 18px;
    }
    
    .btn-spin {
        padding: 14px;
        font-size: 15px;
    }
    
    .speed-label {
        font-size: 12px;
    }
}

@media (min-width: 1600px) {
    .container {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }
    
    .main-content {
        gap: var(--spacing-2xl);
    }
    
    .wheel-container {
        width: 480px;
        height: 480px;
    }
    
    .wheel-pointer {
        margin-top: -240px;
    }
}

.positive {
    color: var(--success);
    font-weight: 600;
}

.negative {
    color: var(--accent-danger);
    font-weight: 600;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.textarea-field {
    width: 100%;
    min-height: 120px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    margin-bottom: var(--spacing-lg);
}

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

@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: var(--spacing-sm) var(--spacing);
    }
    
    
    h1 {
        font-size: 24px;
        margin-bottom: var(--spacing-sm);
    }
    
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing);
        align-items: start;
    }
    
    .wheel-container {
        width: min(280px, 40vw);
        height: min(280px, 40vw);
    }
    
    .wheel-pointer {
        margin-top: calc(min(280px, 40vw) / -2);
    }
    
    .input-section {
        order: 2;
    }
    
    .wheel-section {
        order: 1;
    }
}
