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

body {
    font-family: 'Russo One', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated Background - Simplified */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpi2r9//38gYGAEESAAEGAAasgJOgzJKYwAAAAASUVORK5CYII=') repeat;
    z-index: -2;
    opacity: 0.3;
}

.twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Language Selector on Start Screen */
.start-language-selector {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.start-language-selector label {
    display: block;
    font-family: 'Righteous', cursive;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.start-language-selector select {
    font-family: 'Russo One', sans-serif;
    font-size: 1.3rem;
    padding: 15px 30px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.3) 0%,
                rgba(255, 255, 255, 0.2) 100%),
                linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.start-language-selector select:hover {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.4) 0%,
                rgba(255, 255, 255, 0.3) 100%),
                linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.start-language-selector select option {
    background: #764ba2;
    color: #fff;
    font-size: 1.2rem;
    padding: 10px;
}

/* Header Styles */
.game-header {
    text-align: center;
    margin-bottom: 15px;
    animation: slideDown 1s ease-out;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.logo-wrapper {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.25) 0%,
                rgba(255, 255, 255, 0.15) 100%),
                linear-gradient(135deg, #ff6b6b, #f093fb);
    padding: 10px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                inset 0 2px 0 rgba(255, 255, 255, 0.5);
    display: inline-block;
    border: 3px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.logo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow:
        3px 3px 0 #000,
        5px 5px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 6px;
    margin: 0;
}

.tagline {
    font-family: 'Righteous', cursive;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-top: 5px;
    letter-spacing: 2px;
}

/* Game Info Styles */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    animation: fadeIn 1s ease-out 0.3s both;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.player-info {
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.player-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.red-player {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.blue-player {
    background: linear-gradient(135deg, #667eea 0%, #00d4ff 100%);
}

.player-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.player-info h2 {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.player-info p {
    font-size: 0.9rem;
    margin-top: 3px;
    opacity: 0.9;
}

.score {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    margin-top: 5px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

.turn-indicator {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    text-align: center;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.turn-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.current-turn {
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0.9;
}

.turn-player {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.8rem;
    letter-spacing: 3px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-top: 5px;
}

/* Board Container */
.board-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    animation: fadeIn 1s ease-out 0.5s both;
    flex: 1;
    align-items: center;
    background: radial-gradient(ellipse at center,
                rgba(255, 255, 255, 0.05) 0%,
                transparent 70%);
    border-radius: 30px;
    padding: 20px;
}

/* Hexagon Grid */
.hexagon-grid {
    display: grid;
    grid-template-columns: repeat(5, 95px);
    gap: 18px;
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg,
                rgba(0, 0, 0, 0.1) 0%,
                rgba(0, 0, 0, 0.05) 50%,
                rgba(0, 0, 0, 0.1) 100%);
    border-radius: 25px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2),
                0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Hexagon Styles */
.hexagon {
    width: 95px;
    height: 110px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
    will-change: transform, filter;
    transform: translateZ(0);
}

.hexagon:hover {
    transform: scale(1.12) translateY(-5px) translateZ(0) !important;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

.hexagon-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform: translateZ(0);
}

.hexagon-shape {
    width: 100%;
    height: 100%;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(0, 0, 0, 0.1) 100%),
        linear-gradient(135deg,
            #FFD700 0%,
            #FF8C00 50%,
            #FF6347 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.5),
                inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

/* Glass shine effect */
.hexagon-shape::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    pointer-events: none;
}

/* Glass reflection on top */
.hexagon-shape::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 15%;
    right: 15%;
    height: 35%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    clip-path: polygon(20% 0%, 80% 0%, 70% 100%, 30% 100%);
    pointer-events: none;
}

.hexagon-letter {
    font-family: 'Bebas Neue', cursive;
    font-size: 3rem;
    color: #fff;
    text-shadow:
        0 0 15px rgba(255, 255, 255, 0.6),
        0 3px 6px rgba(0, 0, 0, 0.8),
        2px 2px 0 rgba(0, 0, 0, 0.3);
    z-index: 10;
    font-weight: bold;
    position: relative;
    letter-spacing: 3px;
}

/* Hexagon States - Red Player */
.hexagon.red .hexagon-shape {
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(0, 0, 0, 0.2) 100%),
        linear-gradient(135deg,
            #FF1744 0%,
            #F50057 50%,
            #FF4081 100%);
    border-color: rgba(255, 255, 255, 0.9);
    border-width: 4px;
    box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.6),
                inset 0 -3px 10px rgba(0, 0, 0, 0.4),
                0 0 25px rgba(255, 23, 68, 0.7);
    animation: claimPulse 0.5s ease;
}

/* Hexagon States - Blue Team */
.hexagon.blue .hexagon-shape {
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(0, 0, 0, 0.2) 100%),
        linear-gradient(135deg,
            #2196F3 0%,
            #00BCD4 50%,
            #40C4FF 100%);
    border-color: rgba(255, 255, 255, 0.9);
    border-width: 4px;
    box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.6),
                inset 0 -3px 10px rgba(0, 0, 0, 0.4),
                0 0 25px rgba(33, 150, 243, 0.7);
    animation: claimPulse 0.5s ease;
}

.hexagon.selectable {
    animation: wobble 1s ease infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

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

/* Adjust hexagon positions to create proper grid */
.hexagon:nth-child(5n+1) { transform: translateY(0) translateZ(0); }
.hexagon:nth-child(5n+2) { transform: translateY(55px) translateZ(0); }
.hexagon:nth-child(5n+3) { transform: translateY(0) translateZ(0); }
.hexagon:nth-child(5n+4) { transform: translateY(55px) translateZ(0); }
.hexagon:nth-child(5n) { transform: translateY(0) translateZ(0); }

/* Question Panel */
.question-panel {
    max-width: 800px;
    margin: 30px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 5px solid #f5576c;
    animation: slideUp 0.5s ease;
    position: relative;
}

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

.question-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.letter-badge {
    font-family: 'Bebas Neue', cursive;
    font-size: 4rem;
    color: #fff;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border: 3px solid #fff;
}

.question-header h3 {
    font-family: 'Righteous', cursive;
    font-size: 1.7rem;
    color: #000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

.question-text {
    font-size: 2.2rem;
    color: #000;
    background: #f0f0f0;
    padding: 35px 45px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    border: 3px solid #333;
    line-height: 1.8;
    text-align: center;
    font-family: 'Righteous', cursive;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#answer-input {
    font-family: 'Russo One', sans-serif;
    font-size: 1.2rem;
    padding: 15px 20px;
    border: 3px solid #f5576c;
    border-radius: 10px;
    outline: none;
    background: #fff;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

#answer-input:focus {
    border-color: #f093fb;
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.5);
}

.button-group {
    display: flex;
    gap: 15px;
}

/* Button Styles */
.btn {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.5rem;
    padding: 15px 40px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    flex: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-submit {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.2) 0%,
                rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.btn-skip {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.2) 0%,
                rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: #fff;
}

.btn-start,
.btn-new-game {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.2) 0%,
                rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 2rem;
    padding: 20px 60px;
}

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

.modal-content {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.2) 0%,
                rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    animation: modalPop 0.5s ease;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 100%
    );
    pointer-events: none;
}

@keyframes modalPop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.4;
}

.winner-text {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.winner-subtitle {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Error Modal */
.error-modal-content {
    background: linear-gradient(135deg,
                rgba(255, 255, 255, 0.2) 0%,
                rgba(255, 255, 255, 0.1) 100%),
                linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    padding: 40px;
}

.error-text {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5),
                 0 1px 0 rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.5s ease;
}

.start-content {
    max-width: 800px;
    padding: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.start-title {
    font-family: 'Bangers', cursive;
    font-size: 3rem;
    color: #fff;
    text-align: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.rules {
    margin: 30px 0;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.rule-icon {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
}

.red-hex {
    color: #ff6a00;
    filter: drop-shadow(0 0 10px #ff6a00);
}

.blue-hex {
    color: #00d4ff;
    filter: drop-shadow(0 0 10px #00d4ff);
}

.rule-item p {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.6;
}

.rule-item strong {
    color: #feca57;
}

.start-content .btn-start {
    display: block;
    margin: 30px auto 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }

    .game-info {
        flex-direction: column;
    }

    .hexagon-grid {
        grid-template-columns: repeat(5, 70px);
        gap: 10px;
    }

    .hexagon {
        width: 70px;
        height: 80px;
    }

    .hexagon:nth-child(5n+2),
    .hexagon:nth-child(5n+4) {
        transform: translateY(40px);
    }

    .hexagon-letter {
        font-size: 2rem;
    }

    .question-panel {
        padding: 20px;
    }
}
