﻿/* Lucky Wheel Game - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 150px 30px 30px;
    background: linear-gradient(135deg, #e8f6ff 0%, #ffe9c9 50%, #ffeef7 100%);
    min-height: 100vh;
}

:root {
    --wheel-size: min(86vw, calc(100vh - 220px), 720px);
    --wheel-h-padding: 80px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 30px;
}

/* Fixed Header Styles */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 100;
}

.page-header .header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    margin: 0;
    color: #333;
    font-size: 2.1em;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.title-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a, .lang-selector {
    text-decoration: none;
    color: #333;
    background: #ffffff;
    padding: 9px 18px;
    border-radius: 20px;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    border: 1px solid rgba(0,0,0,0.35);
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
}

.nav-links a:hover, .lang-selector:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.lang-selector {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links a, .lang-toggle {
    border: 1px solid rgba(0,0,0,0.35);
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.35);
    padding: 9px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    color: #333;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.lang-toggle:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.lang-toggle img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.lang-caret {
    margin-left: 4px;
    font-size: 0.85em;
    opacity: 0.7;
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    min-width: 190px;
    padding: 6px;
    display: none;
    z-index: 200;
}

.lang-dropdown.open .lang-menu {
    display: block;
}

.lang-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

.lang-item:hover {
    background: #f5f5f5;
}

.lang-item img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* Content Layout */
.content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 30px;
    align-items: start;
    padding-top: 18px;
}

@media (max-width: 1100px) {
    :root {
        --wheel-size: min(90vw, calc(100vh - 220px), 640px);
    }
    .content {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
    }
}

@media (max-width: 900px) {
    :root {
        --wheel-size: min(94vw, calc(100vh - 220px), 560px);
    }
    .content {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    }
}

@media (max-width: 768px) {
    :root {
        --wheel-size: min(calc(100vw - var(--wheel-h-padding)), calc(100vh - 220px), 500px);
    }
    .content {
        grid-template-columns: 1fr;
    }
    .header h1 {
        font-size: 1.5em;
    }
    body {
        padding: 130px 15px 15px;
        --wheel-h-padding: 70px;
    }
    .container {
        padding: 15px 15px 20px;
    }
    .page-header .header {
        padding: 10px 15px;
    }
    .nav-links {
        gap: 8px;
    }
    .nav-links a, .lang-toggle {
        padding: 7px 12px;
        font-size: 0.88em;
    }
}

@media (max-width: 480px) {
    :root {
        --wheel-h-padding: 50px;
        --wheel-size: min(calc(100vw - var(--wheel-h-padding)), calc(100vh - 200px), 400px);
    }
    body {
        padding: 120px 10px 10px;
    }
    .container {
        padding: 10px 10px 15px;
    }
    .page-header .header {
        padding: 8px 10px;
    }
    .header h1 {
        font-size: 1.25em;
    }
    .title-icon {
        width: 22px;
        height: 22px;
    }
    .nav-links {
        gap: 6px;
    }
    .nav-links a, .lang-toggle {
        padding: 6px 10px;
        font-size: 0.82em;
    }
    .wheel::before {
        width: 54px;
        height: 54px;
        font-size: 11px;
    }
    .wheel-pointer {
        border-left: 14px solid transparent;
        border-right: 14px solid transparent;
        border-top: 24px solid #2c2c2c;
    }
    .players-section {
        padding: 15px;
    }
}

/* Wheel Section */
.wheel-section {
    text-align: center;
    margin-top: 0;
    padding-top: 0;
}

.wheel-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.wheel-container {
    position: relative;
    width: var(--wheel-size);
    height: var(--wheel-size);
    margin: 0 auto 20px;
}

@media (max-width: 1100px) {
    .wheel-container {
        width: var(--wheel-size);
    }
}

@media (max-width: 900px) {
    .wheel-container {
        width: var(--wheel-size);
    }
}

@media (max-width: 700px) {
    .wheel-container {
        width: var(--wheel-size);
    }
}

@media (max-width: 500px) {
    .wheel-container {
        width: var(--wheel-size);
    }
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    /* GPU-accelerate so rotation runs on compositor, independent of child repaints */
    will-change: transform;
}

.wheel-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 0;
}

.wheel.idle-spin {
    animation: idleRotate 18s linear infinite;
}

@keyframes idleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wheel::before {
    content: 'SPIN';
    position: absolute;
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.1);
    border: 4px solid rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    user-select: none;
}

.wheel-hint-arc {
    position: absolute;
    inset: 0;
    transform: translateY(36px);
    pointer-events: none;
    z-index: 9;
}

.wheel-hint-arc.hidden {
    opacity: 0;
}

.wheel-hint-arc text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 26px;
    font-weight: 800;
    fill: #ffffff;
    text-shadow: 0 3px 6px rgba(0,0,0,0.35);
    letter-spacing: 1px;
}

@media (max-width: 700px) {
    .wheel-hint-arc text {
        font-size: 21px;
    }
}

.wheel.spinning {
    animation: spin 5.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(1800deg); }
}

.segment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 50% 50%;
    font-weight: 600;
    font-size: clamp(12px, 2.2vw, 16px);
    white-space: nowrap;
    max-width: clamp(70px, 18vw, 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 6;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid #2c2c2c;
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.06);
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    font-weight: 600;
}

.btn-primary {
    background: #6f8ff5;
    color: #fff;
}

.btn-primary:hover {
    background: #627de0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(111, 143, 245, 0.35);
}

.btn-success {
    background: #5cc9a8;
    color: #fff;
}

.btn-success:hover {
    background: #4db695;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(92, 201, 168, 0.35);
}

.btn-danger {
    background: #f4b35c;
    color: #fff;
}

.btn-danger:hover {
    background: #e2a34f;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(244, 179, 92, 0.35);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Players Section */
.players-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    justify-self: end;
}

.players-section h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.players-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.players-header h2 {
    margin-bottom: 0;
}

.players-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-player {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-player input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    min-width: 150px;
}

#playersTextarea {
    margin-top: 10px;
    width: 100%;
    flex: 1;
    height: clamp(260px, calc(var(--wheel-size) - 180px), 480px);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1em;
    resize: vertical;
}

@media (max-width: 900px) {
    #playersTextarea {
        min-height: 360px;
    }
}

@media (max-width: 700px) {
    .players-section {
        max-width: 100%;
        justify-self: stretch;
    }
    #playersTextarea {
        height: clamp(220px, 42vh, 360px);
        min-height: 260px;
    }
}

@media (max-width: 700px) {
    .wheel-section {
        margin-top: 6px;
    }
}

.players-list {
    max-height: 400px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

.player-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-name {
    font-weight: bold;
    flex: 1;
    margin-right: 10px;
}

.player-actions {
    display: flex;
    gap: 5px;
}

.player-actions button {
    padding: 5px 10px;
    font-size: 0.85em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.close {
    color: #999;
    float: right;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.result-modal {
    text-align: center;
}

.result-modal h2 {
    font-size: 2em;
    color: #f5576c;
    margin: 20px 0;
}

.result-modal p {
    font-size: 1.3em;
    margin: 20px 0;
    color: #333;
}

.result-modal label {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    font-size: 1em;
    color: #555;
}

.result-modal input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 100;
}

/* Footer Description */
.footer-desc {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    color: #555;
    line-height: 1.8;
    text-align: justify;
    font-size: 0.95em;
}

/* About Page */
.about-page {
    padding-top: 90px;
}

.about-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 20px 40px;
}

.about-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 32px;
    color: #333;
}

.about-card h2 {
    font-size: 1.6em;
    margin: 25px 0 12px;
    color: #333;
}

.about-card p {
    margin-bottom: 12px;
    line-height: 1.75;
    color: #555;
}

.about-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 2px solid #eee;
    color: #888;
    font-style: italic;
}

.back-link {
    display: inline-block;
    margin-top: 18px;
    text-decoration: none;
    color: #ffffff;
    background: #6f8ff5;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 700;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.back-link:hover {
    background: #627de0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(111, 143, 245, 0.35);
}






.players-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.players-actions-row .btn {
    flex: 1;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.35);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    color: #333;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.icon-btn img {
    width: 35px;
    height: 35px;
    display: block;
}

.icon-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.nav-links .icon-btn {
    margin-top: 6px;
}









