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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1400px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: clamp(1.8em, 5vw, 2.5em);
    text-transform: uppercase;
    letter-spacing: 2px;
    word-break: break-word;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.wheel-container {
    position: relative;
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    margin: 0 auto;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff4444;
    z-index: 10;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}

.pointer::after {
    content: '';
    position: absolute;
    top: -45px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
}

.controls-panel {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h3 {
    color: #555;
    margin-bottom: 12px;
    font-size: clamp(1.1em, 4vw, 1.3em);
    text-align: right;
}

.spin-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.spin-controls button {
    flex: 1;
    padding: 15px;
    font-size: clamp(1em, 4vw, 1.2em);
    font-weight: bold;
    min-width: 200px;
}

button {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9em, 3.5vw, 1em);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    width: 100%;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #999 0%, #666 100%);
}

.last-spin-time {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    font-size: clamp(0.9em, 3.5vw, 1em);
}

.result-area {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
}

.result-title {
    font-size: clamp(1em, 4vw, 1.2em);
    margin-bottom: 8px;
    opacity: 0.9;
}

.result-value {
    font-size: clamp(1.5em, 6vw, 2.5em);
    font-weight: bold;
    word-break: break-word;
}

.history-section {
    margin-top: 20px;
}

.history-list {
    max-height: 180px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #eee;
}

.history-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.85em, 3vw, 0.95em);
}

.history-item:last-child {
    border-bottom: none;
}

.history-prize {
    font-weight: 600;
    color: var(--secondary-color);
    word-break: break-word;
    flex: 1;
}

.history-time {
    color: #999;
    font-size: 0.9em;
    white-space: nowrap;
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* تحسينات للأجهزة الصغيرة */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .controls-panel {
        padding: 15px;
    }
    
    .spin-controls button {
        padding: 12px;
    }
}

/* تنسيق الفوتر */
.footer {
    margin-top: 30px;
    padding: 20px 10px 10px 10px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    text-align: center;
    font-size: clamp(1em, 3.5vw, 1.1em);
    background: rgba(255,255,255,0.7);
    border-radius: 15px 15px 0 0;
}

.footer .designer {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.footer .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    align-items: center;
    margin: 10px 0;
}

.footer a {
    text-decoration: none;
    color: var(--secondary-color);
    background: rgba(255,255,255,0.8);
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid #dcdcdc;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer a i {
    font-style: normal;
    font-size: 1.2em;
}

.footer a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.3);
}

.footer .phone {
    background: #f8f9fa;
    padding: 8px 20px;
    border-radius: 50px;
    color: #333;
    border: 1px solid #dee2e6;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer .phone span {
    color: #28a745;
    font-weight: 700;
}