:root {
    --color-primary: #ff7a00;
    --color-primary-hover: #ff8f26;
    --color-primary-dark: #ff3c00;
    --color-primary-soft: #fff7ef;
    --color-primary-lighter: #ffe0bf;

    --color-border: #ffd0a2;
    --color-border-strong: #ffb47a;

    --color-text: #333333;
    --color-text-dark: #222222;
    --color-text-muted: #999999;
    --color-white: #ffffff;

    --color-danger-bg: #ffe4e4;
    --color-danger-border: #e53935;
    --color-success: #198754;

    --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-orange: 0 10px 35px rgba(255, 122, 0, 0.25);

    --radius-small: 10px;
    --radius-medium: 12px;
    --radius-card: 16px;
    --radius-large: 26px;
    --radius-pill: 999px;
}

/* =========================
   Base
========================= */

body {
    margin: 0;
    font-family: "Changa", "Segoe UI", sans-serif;
    direction: rtl;
    background: var(--color-primary-soft);
    color: var(--color-text);
}

form {
    margin: 0;
}

h1,
h2 {
    color: var(--color-primary);
    margin-top: 0;
    text-align: center;
}

label {
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-small);
    border: 1px solid var(--color-border);
    margin-bottom: 12px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

input[type="file"] {
    margin-bottom: 12px;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

/* =========================
   Layout
========================= */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px 28px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

.main-card {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 35px;
    background: var(--color-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-orange);
    box-sizing: border-box;
}

/* =========================
   Buttons
========================= */

.btn {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 22px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    font-family: inherit;
}

.btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 5px 15px rgba(255, 122, 0, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
    background: #ffe8d2;
}

/* =========================
   Shared Utilities
========================= */

.center-actions {
    text-align: center;
    margin-top: 20px;
}

.center-title {
    text-align: center;
}

.error-message {
    color: red;
    font-weight: 700;
    text-align: center;
}

.success-message {
    color: var(--color-success);
    font-weight: 700;
    text-align: center;
}

.muted-text {
    color: var(--color-text-muted);
}

.form-actions {
    margin-top: 20px;
}

.large-actions {
    margin-top: 35px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    font-weight: 600;
}

.file-input {
    margin-top: 10px;
    margin-bottom: 16px;
}

.input-text {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border-strong);
    border-radius: var(--radius-medium);
    font-size: 18px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* =========================
   Modals
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.modal {
    background: var(--color-white);
    padding: 24px;
    border-radius: var(--radius-card);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 320px;
    max-width: 90%;
}

/* =========================
   Clean Forms
========================= */

.form-card {
    max-width: 980px;
    border-radius: 28px;
    padding: 34px 38px;
    box-shadow: 0 18px 45px rgba(255, 122, 0, 0.14);
}

.create-genre-card {
    max-width: 760px;
}

.question-form-card {
    max-width: 1050px;
}

.form-card h1 {
    font-size: 34px;
    font-weight: 900;
    margin-bottom: 6px;
}

.form-subtitle {
    text-align: center;
    color: #666666;
    font-size: 17px;
    margin: 0 0 28px;
}

.clean-form {
    width: 100%;
}

.form-section {
    background: #fffaf5;
    border: 1px solid #ffe0bf;
    border-radius: 22px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.form-section h3 {
    color: var(--color-primary);
    font-size: 22px;
    margin: 0 0 18px;
    text-align: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.clean-form label {
    color: var(--color-text-dark);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 7px;
}

.clean-form input[type="text"],
.clean-form input[type="password"],
.clean-form input[type="number"],
.clean-form select,
.clean-form textarea {
    background: var(--color-white);
    border: 2px solid #ffd3a3;
    border-radius: 15px;
    padding: 13px 15px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clean-form input[type="text"]:focus,
.clean-form input[type="password"]:focus,
.clean-form input[type="number"]:focus,
.clean-form select:focus,
.clean-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
}

.clean-form textarea {
    min-height: 90px;
}

.clean-form input[type="file"] {
    width: 100%;
    background: var(--color-white);
    border: 2px dashed #ffc078;
    border-radius: 15px;
    padding: 13px;
    cursor: pointer;
    box-sizing: border-box;
}

.clean-form input[type="file"]::file-selector-button {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    margin-left: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.clean-form input[type="file"]::file-selector-button:hover {
    background: var(--color-primary-hover);
}

.clean-form .form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.clean-form .btn {
    min-width: 130px;
    font-size: 17px;
    font-weight: 700;
    padding: 12px 26px;
}

/* =========================
   Admin Login
========================= */

.admin-login-card {
    max-width: 400px;
    text-align: center;
}

.login-action {
    margin-top: 12px;
}

/* =========================
   Main Menu
========================= */

.hero {
    width: 100%;
    padding: 60px 0 80px;
    text-align: center;
    background: linear-gradient(90deg, var(--color-primary-dark), #ff8a00);
    color: var(--color-white);
}

.hero h1 {
    font-size: 70px;
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: -1px;
    color: var(--color-white);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.hero p {
    font-size: 22px;
    opacity: 0.95;
}

.wave {
    margin-top: -2px;
}

.features {
    margin-top: -40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.feature-card {
    width: 150px;
    height: 150px;
    background: var(--color-white);
    border-radius: 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    text-align: center;
    transition: 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.feature-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.feature-card span:last-child {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.info-section {
    padding: 60px 10%;
    text-align: center;
}

.info-section h2 {
    font-size: 36px;
    color: var(--color-text-dark);
    margin-bottom: 12px;
}

.info-section p {
    font-size: 20px;
    color: #444444;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =========================
   Feedback
========================= */

.feedback-section {
    max-width: 520px;
    margin: 45px auto 0;
    padding: 24px 28px;
    background: var(--color-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.feedback-section h2 {
    margin-bottom: 8px;
}

.feedback-section p {
    margin-top: 0;
    color: #555555;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feedback-form textarea {
    width: 100%;
    max-width: 480px;
    min-height: 90px;
    max-height: 140px;
    text-align: center;
    resize: vertical;
}

.feedback-form .btn {
    align-self: center;
    margin-top: 10px;
}

/* =========================
   Game Board
========================= */

.board {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

.genre-column {
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    padding: 12px;
    width: 280px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 6px;
    align-items: center;
}

.genre-center {
    grid-row: 1 / span 3;
    grid-column: 2 / 3;
    text-align: center;
}

.genre-center img,
.genre-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    margin-bottom: 6px;
}

.genre-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text);
}

.question-button-form {
    margin: 4px 0;
}

.q-btn {
    width: 100%;
    text-align: center;
    padding: 8px 4px;
    border-radius: var(--radius-medium);
    border: none;
    cursor: pointer;
    background: var(--color-primary-lighter);
    font-weight: 600;
}

.q-btn.used {
    background: #f1f1f1;
    color: #aaaaaa;
    cursor: default;
}

.score-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    font-weight: 700;
    color: var(--color-primary);
}

/* =========================
   Manage Genres
========================= */

.genre-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.genre-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-white);
    padding: 12px;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-soft);
}

.genre-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.genre-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
}

.genre-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================
   Edit Genre
========================= */

.edit-genre-card {
    max-width: 900px;
    text-align: center;
}

.preview-box {
    width: 140px;
    height: 140px;
    margin: 20px auto;
    border: 3px solid var(--color-primary);
    border-radius: var(--radius-card);
    background: #eeeeee;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   Manage Questions
========================= */

.genre-select {
    margin-bottom: 16px;
    text-align: center;
}

.question-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.question-table th,
.question-table td {
    border-bottom: 1px solid #eeeeee;
    padding: 8px;
    text-align: right;
}

.question-table th {
    background: #fff7ed;
}

/* =========================
   Edit Question / Media
========================= */

.edit-question-card {
    max-width: 700px;
}

.media-block {
    margin-top: 15px;
    margin-bottom: 18px;
    text-align: center;
}

.media-label {
    font-weight: 700;
    margin-bottom: 6px;
}

.media-preview {
    max-width: 180px;
    max-height: 120px;
    border-radius: var(--radius-small);
    display: block;
    margin: 8px 0;
}

/* =========================
   Question View
========================= */

.question-view-card {
    text-align: center;
}

.question-text,
.answer-text {
    font-size: 22px;
    line-height: 1.8;
}

.question-media-image {
    max-width: 450px;
    max-height: 300px;
    border-radius: var(--radius-medium);
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.question-media-video,
.question-media-audio {
    margin-top: 10px;
    max-width: 450px;
    border-radius: var(--radius-medium);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reveal-button {
    margin-top: 16px;
}

.answer-block {
    display: none;
    margin-top: 20px;
}
.question-timer {
    width: fit-content;
    min-width: 105px;
    margin: 0 auto 22px;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: var(--color-white);
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.24);
    text-align: center;
}

.timer-label {
    text-align: center;
    color: #666666;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 22px;
}

.question-timer.timer-overtime {
    background: linear-gradient(135deg, #e53935, #ff1744);
    box-shadow: 0 8px 24px rgba(229, 57, 53, 0.35);
    animation: timer-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.06);
    }
}
/* =========================
   Start Game
========================= */

.start-hero {
    padding: 55px 0;
    background: linear-gradient(90deg, var(--color-primary-dark), #ff8a00);
    text-align: center;
    color: var(--color-white);
}

.start-hero h1 {
    font-size: 56px;
    font-weight: 900;
    color: var(--color-white);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.start-hero p {
    font-size: 22px;
    opacity: 0.95;
}

.counter-big {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 18px 0 12px;
}

.start-genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.start-genre-card {
    width: 135px;
    height: 185px;
    margin: auto;
    background: var(--color-white);
    border-radius: 25px;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.start-genre-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255, 122, 0, 0.35);
}

.start-genre-card.selected {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 0 0 4px #ff8b22, 0 6px 18px rgba(255, 136, 0, 0.35);
}

.start-genre-card input[type="checkbox"] {
    display: none;
}

.invalid-card {
    background: var(--color-danger-bg);
    border: 2px solid var(--color-danger-border);
    opacity: 0.85;
}

.start-card-img-container {
    height: 130px;
    background: #d8eaff;
    border-radius: 22px 22px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-genre-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-medium);
}

.start-card-title {
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 17px;
    padding: 14px 4px;
    text-align: center;
    font-weight: 600;
    border-radius: 0 0 25px 25px;
    margin: 0;
    flex-shrink: 0;
}

.team-row {
    margin-top: 28px;
    display: flex;
    gap: 15px;
}

.team-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--color-border-strong);
    border-radius: var(--radius-medium);
    font-size: 17px;
}

/* =========================
   Winner Page
========================= */

.winner-body {
    overflow: hidden;
}

.fireworks-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 200, 150, 0.4), transparent 60%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.35), transparent 55%),
        radial-gradient(circle at 50% 80%, rgba(255, 140, 0, 0.4), transparent 60%),
        #1d1b27;
    z-index: -2;
}

.winner-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-card {
    position: relative;
    text-align: center;
    padding: 30px 40px;
    border-radius: 24px;
    background: linear-gradient(145deg, #fff8f0, var(--color-white));
    box-shadow: 0 0 35px rgba(255, 122, 0, 0.6);
    animation: glow 2.5s ease-in-out infinite alternate;
}

.winner-icon {
    font-size: 64px;
    margin-bottom: 8px;
    animation: bounce-in 1s ease-out;
}

.crown {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%) rotate(-8deg);
    font-size: 52px;
    animation: crown-pop 1.2s ease-out;
}

.winner-title {
    font-size: 32px;
    margin-bottom: 8px;
    animation: text-pop 0.9s ease-out;
}

.winner-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.scores {
    margin-top: 18px;
    font-size: 18px;
}

.scores div {
    margin: 4px 0;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 14px;
    background-color: var(--color-primary);
    top: -20px;
    border-radius: 2px;
    opacity: 0.9;
    z-index: 5;
    animation: confetti-fall linear forwards;
}

/* =========================
   Animations
========================= */

@keyframes glow {
    from {
        box-shadow: 0 0 18px rgba(255, 122, 0, 0.4);
        transform: translateY(0);
    }

    to {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.8);
        transform: translateY(-4px);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }

    60% {
        opacity: 1;
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes crown-pop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) rotate(-25deg) scale(0.6);
    }

    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(5px) rotate(-5deg) scale(1.1);
    }

    100% {
        transform: translateX(-50%) translateY(0) rotate(-8deg) scale(1);
    }
}

@keyframes text-pop {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes confetti-fall {
    0% {
        transform: translate3d(0, 0, 0) rotateZ(0deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(var(--x-move), 110vh, 0) rotateZ(360deg);
        opacity: 0;
    }
}

.announcement-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    box-sizing: border-box;
}

.announcement-box {
    width: 100%;
    max-width: 520px;
    background: var(--color-white);
    border-radius: 28px;
    padding: 32px 34px;
    text-align: center;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
    border: 2px solid #ffe0bf;
    animation: announcement-pop 0.35s ease-out;
}

.announcement-icon {
    font-size: 46px;
    margin-bottom: 8px;
}

.announcement-box h2 {
    color: var(--color-primary);
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 12px;
}

.announcement-box p {
    color: #444444;
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.announcement-box ul {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    text-align: right;
}

.announcement-box li {
    background: #fff7ef;
    border: 1px solid #ffe0bf;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--color-text-dark);
}

.announcement-box li::before {
    content: "✓";
    color: var(--color-primary);
    font-weight: 900;
    margin-left: 8px;
}

@keyframes announcement-pop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .announcement-box {
        padding: 26px 22px;
    }

    .announcement-box h2 {
        font-size: 25px;
    }

    .announcement-box p {
        font-size: 16px;
    }
}
/* =========================
   Responsive
========================= */

@media (max-width: 768px) {
    .card,
    .main-card {
        padding: 20px;
    }

    .form-card {
        padding: 26px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .clean-form .form-actions {
        flex-direction: column;
    }

    .clean-form .btn {
        width: 100%;
        text-align: center;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero p,
    .start-hero p {
        font-size: 18px;
    }

    .start-hero h1 {
        font-size: 42px;
    }

    .team-row {
        flex-direction: column;
    }

    .score-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .genre-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .genre-actions {
        justify-content: center;
    }

    .question-table {
        font-size: 13px;
    }

    .question-media-image,
    .question-media-video,
    .question-media-audio {
        max-width: 100%;
    }

    .feedback-section {
        max-width: calc(100% - 40px);
        padding: 22px 20px;
    }

    .winner-card {
        padding: 28px 22px;
    }
}