:root {
    --primary-hue: 260;
    /* Purple */
    --bg-gradient: linear-gradient(135deg, #1a1a2e, #16213e);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --accent-color: #e94560;
    --success-color: #4cc9f0;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background Blobs Animation */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: #4cc9f0;
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #7209b7;
    bottom: -100px;
    right: -100px;
    animation-delay: -2s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #f72585;
    top: 40%;
    left: 40%;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* Glassmorphism Container */
.app-container {
    width: 90%;
    max-width: 500px;
    min-height: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    transition: all 0.3s ease;
}

/* Typography */
h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #4cc9f0, #f72585);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 2rem;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
}

input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--success-color);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: var(--font-main);
    border: none;
    transition: transform 0.2s, opacity 0.2s;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(45deg, #4cc9f0, #4361ee);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    width: 100%;
    font-size: 1rem;
}

.btn-mode {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 16px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.btn-mode.selected {
    background: rgba(247, 37, 133, 0.2);
    border-color: #f72585;
}

.buttons-row {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-success {
    background: #06d6a0;
    color: white;
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    font-weight: bold;
}

.btn-danger {
    background: #ef476f;
    color: white;
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    font-weight: bold;
}

/* Sections & Visibility */
section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Game Interface Specifics */
.game-header {
    width: 100%;
    margin-bottom: 1.5rem;
}

.score-board {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.team-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.team-1 {
    color: #4cc9f0;
}

.team-2 {
    color: #f72585;
}

.score-digit {
    font-size: 1.5rem;
    font-weight: 700;
}

.vs-badge {
    font-weight: 900;
    font-style: italic;
    opacity: 0.5;
}

.card-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.turn-indicator {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.highlight-team {
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.t1-color {
    color: #4cc9f0;
}

.t2-color {
    color: #f72585;
}

/* Dynamic Background Themes */
body {
    transition: background 1s ease;
}

body.theme-team1 {
    background: linear-gradient(135deg, #1a1a2e, #0f2027, #203a43, #2c5364);
    /* Blue-ish */
}

body.theme-team2 {
    background: linear-gradient(135deg, #1a1a2e, #2b102f, #4a1c40);
    /* Pink-ish */
}

/* 3D Word Card */
.word-card-3d {
    background: transparent;
    width: 100%;
    height: 200px;
    perspective: 1000px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* Front and Back common */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Front Style */
.card-front {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.card-logo {
    font-size: 4rem;
    opacity: 0.3;
    font-weight: bold;
}

/* Back Style */
.card-back {
    background: rgba(0, 0, 0, 0.6);
    transform: rotateY(180deg);
    padding: 1rem;
}

.category-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.4);
}

#secret-word {
    font-size: 2rem;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    word-wrap: break-word;
    max-width: 100%;
}

.tap-hint {
    position: absolute;
    bottom: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

/* Settings Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.setting-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #ffd700;
}

.setting-options {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.btn-option {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-option.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: bold;
}

.shortcuts-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.9rem;
}

.shortcuts-info h3 {
    margin-top: 0;
    color: #4cc9f0;
    font-size: 1rem;
}

.shortcuts-info p {
    margin: 0.3rem 0;
    opacity: 0.8;
}

.settings-trigger {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

/* Controls */
.controls-area {
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.buttons-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    margin-top: 1rem;
}

.btn-team-1 {
    background: rgba(76, 201, 240, 0.2);
    border: 1px solid #4cc9f0;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: bold;
}

.btn-team-1:hover {
    background: rgba(76, 201, 240, 0.4);
}

.btn-team-2 {
    background: rgba(247, 37, 133, 0.2);
    border: 1px solid #f72585;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: bold;
}

.btn-team-2:hover {
    background: rgba(247, 37, 133, 0.4);
}

.btn-skip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.8rem;
    border-radius: 12px;
}

/* Results Screen */
.winner-trophy {
    font-size: 5rem;
    margin: 1rem 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

#winner-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.final-score-text {
    font-size: 1.5rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.rules-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
    width: 100%;
}

/* V3 Enhancements */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-display {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.timer-fg {
    fill: none;
    stroke: #4cc9f0;
    stroke-width: 8;
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

#timer-text {
    position: absolute;
    font-size: 1rem;
    font-weight: bold;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1000;
}