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

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--tg-theme-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--tg-theme-secondary-bg-color);
    border-top: 4px solid var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Screens */
.screen {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--tg-theme-button-color) 0%, #1a6fb8 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.header h2 {
    font-size: 20px;
}

.back-btn {
    position: absolute;
    left: 10px;
    top: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.user-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    gap: 15px;
}

.balance, .reviews-count {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 12px;
    flex: 1;
}

.balance-amount {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-top: 5px;
}

.reviews-count span:last-child {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-top: 5px;
}

/* Content */
.content {
    padding: 20px;
}

.welcome-message {
    background: var(--tg-theme-secondary-bg-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.welcome-message p {
    margin: 10px 0;
    line-height: 1.5;
}

/* Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #2481cc 0%, #1a6fb8 100%);
    color: white;
}

.btn-secondary {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-spin {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-admin {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.btn-large {
    padding: 20px;
    font-size: 18px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    margin-top: 10px;
}

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

/* Platforms List */
.platforms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-card {
    background: white;
    border: 2px solid var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.platform-card:hover {
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.2);
}

.platform-info h3 {
    margin-bottom: 5px;
    color: var(--tg-theme-text-color);
}

.platform-reward {
    color: #27ae60;
    font-weight: bold;
    font-size: 18px;
}

/* Review Instructions */
.review-instructions {
    background: var(--tg-theme-secondary-bg-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.review-instructions h3 {
    margin-bottom: 15px;
}

.review-instructions ol {
    padding-left: 20px;
    line-height: 1.8;
}

.reward-info {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

/* Upload Area */
.upload-area {
    margin: 20px 0;
}

.upload-placeholder {
    border: 3px dashed var(--tg-theme-hint-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    border-color: var(--tg-theme-button-color);
    background: var(--tg-theme-secondary-bg-color);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.image-preview {
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-card {
    background: white;
    border: 1px solid var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
}

.review-card h3 {
    margin-bottom: 8px;
    color: var(--tg-theme-button-color);
}

.review-card p {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

/* Wheel */
.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
}

.wheel-arrow {
    position: absolute;
    top: -20px;
    font-size: 40px;
    color: var(--tg-theme-button-color);
    z-index: 10;
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 90vw;
    height: auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

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

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

/* Admin Panel Link */
.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--tg-theme-button-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
}
