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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 3.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}

/* Player Setup */
.player-setup {
    text-align: center;
    margin-bottom: 40px;
}

.player-setup input {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    width: 300px;
    max-width: 90%;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover:not(.coming-soon) {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.game-card.coming-soon {
    opacity: 0.7;
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.game-info {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.game-description {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-disabled {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4CAF50;
    color: white;
}

.btn-secondary:hover {
    background: #45a049;
}

.btn-disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: rgba(255,255,255,0.3);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
}

/* Room Screen */
.room-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-top: 40px;
}

.option-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.option-card h3 {
    margin-bottom: 10px;
    color: #333;
}

.option-card p {
    color: #666;
    margin-bottom: 20px;
}

.option-card input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.divider {
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
}

.error-message {
    color: #ff4444;
    background: white;
    padding: 10px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Waiting Room */
#waitingRoom h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.room-info {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.room-info span {
    font-weight: bold;
}

.players-list {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.players-list h3 {
    margin-bottom: 15px;
}

.players-list ul {
    list-style: none;
}

.players-list li {
    padding: 10px;
    margin-bottom: 5px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.players-list .host-badge {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.host-controls {
    text-align: center;
}

.grid-size-selector {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.grid-size-selector label {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.grid-size-selector select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid white;
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.grid-size-selector select:hover {
    background: #f0f0f0;
}

.hint {
    color: white;
    margin-top: 10px;
    font-size: 0.9rem;
}

.waiting-message {
    text-align: center;
    color: white;
    font-size: 1.1rem;
}

/* Game Rules */
.game-rules {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.game-rules h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.game-rules ul {
    list-style: none;
    padding-left: 0;
}

.game-rules li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.game-rules li:last-child {
    border-bottom: none;
}

.game-rules .rule-icon {
    display: inline-block;
    width: 25px;
    margin-right: 10px;
}

/* Game Container */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 80vh;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.game-stats span {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 10px;
}

/* Go Fish Game */
.players-area {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.player-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    min-width: 150px;
}

.player-info.current-turn {
    background: #e8f5e9;
    border: 2px solid #4CAF50;
}

.player-info h4 {
    margin-bottom: 5px;
}

.player-info .stats {
    font-size: 0.9rem;
    color: #666;
}

.my-hand {
    margin-bottom: 30px;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.rank-group {
    display: flex;
    gap: 3px;
    padding: 5px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.05);
}

.card {
    width: 60px;
    height: 90px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card.red {
    color: red;
}

.card.matching {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    background: #f0fff0;
}

.game-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.game-controls select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.game-controls button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.game-controls button:hover {
    background: #45a049;
}

.game-log {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.game-log p {
    margin-bottom: 5px;
    padding: 5px;
    background: white;
    border-radius: 5px;
}

/* Hangman Game */
.hangman-display {
    text-align: center;
    margin-bottom: 30px;
}

.word-display {
    text-align: center;
    margin-bottom: 30px;
}

.word-display h3 {
    font-size: 2.5rem;
    letter-spacing: 10px;
    color: #333;
}

.guessed-letters {
    text-align: center;
    margin-bottom: 20px;
}

.guessed-letters span {
    font-size: 1.2rem;
    letter-spacing: 5px;
    color: #666;
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.letter-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.letter-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

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

.word-guess {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.word-guess input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.game-message {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.1rem;
}

/* Hangman Sorry Stamp Animation */
.sorry-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(0);
    font-size: 4rem;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    border: 5px solid #ff0000;
    padding: 20px 40px;
    border-radius: 15px;
    background: rgba(255,255,255,0.9);
    z-index: 1000;
    animation: stampAnimation 0.5s ease-out forwards;
}

@keyframes stampAnimation {
    0% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(-15deg) scale(1);
        opacity: 1;
    }
}

.hangman-container {
    position: relative;
    display: inline-block;
}

/* Winner Message for Word Setter */
.winner-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(5deg) scale(0);
    font-size: 2.5rem;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    border: 4px solid #4CAF50;
    padding: 15px 30px;
    border-radius: 15px;
    background: rgba(232, 245, 233, 0.95);
    z-index: 1000;
    animation: winnerAnimation 0.5s ease-out forwards;
}

@keyframes winnerAnimation {
    0% {
        transform: translate(-50%, -50%) rotate(5deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) rotate(5deg) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(5deg) scale(1);
        opacity: 1;
    }
}

/* Draw & Guess Game */
.draw-area {
    margin-bottom: 30px;
}

.canvas-container {
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    display: inline-block;
    background: white;
    margin-bottom: 20px;
}

#drawCanvas {
    display: block;
    cursor: crosshair;
}

.drawing-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.color-palette {
    display: flex;
    gap: 10px;
}

.color-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.2);
}

.brush-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.brush-controls input[type="range"] {
    width: 100px;
}

.word-choices {
    text-align: center;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.word-choices h3 {
    margin-bottom: 15px;
}

#wordButtons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

#wordButtons button {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
}

#wordButtons button:hover {
    background: #5568d3;
}

.word-hint {
    text-align: center;
    background: #e8f5e9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.word-hint h3 {
    font-size: 1.8rem;
    letter-spacing: 5px;
}

.intermission {
    background: #667eea;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 10px;
}

.intermission h3 {
    margin-bottom: 20px;
    font-size: 2rem;
}

#intermissionCountdown {
    font-size: 5rem;
    font-weight: bold;
}

.game-sidebar {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.players-scores {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
}

.players-scores ul {
    list-style: none;
}

.players-scores li {
    padding: 8px;
    margin-bottom: 5px;
    background: white;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
}

.players-scores .drawing {
    background: #e8f5e9;
}

.chat-area {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.chat-message {
    padding: 8px;
    margin-bottom: 5px;
    background: white;
    border-radius: 5px;
}

.chat-message.correct {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: bold;
}

.guess-input {
    display: flex;
    gap: 10px;
}

.guess-input input {
    flex: 1;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
}

.guess-input button {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Game Over Screen */
.game-over {
    text-align: center;
    padding: 40px;
}

.game-over h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    color: #667eea;
}

#winnerDisplay {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

#finalScores {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.game-over-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Ice Fishing Game */
.ice-fishing-area {
    padding: 20px;
}

.fishing-view {
    text-align: center;
}

.fishing-view h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

.fishing-view p {
    color: #666;
    margin-bottom: 30px;
}

/* Ice Holes Layout */
.ice-holes {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    gap: 30px;
}

.hole-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hole {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
}

.hole-number {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    color: #667eea;
}

.ice-hole {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1e3c72 0%, #2a5298 40%, #7e8ba3 100%);
    border-radius: 50%;
    border: 5px solid #e0f2f1;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.8);
}

.bobber {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: red;
    z-index: 10;
    transition: all 0.3s;
}

.bobber.bobbing {
    animation: bobbing 0.3s ease-in-out 3;
}

.bobber.yanking {
    animation: yankBobber 0.5s ease-out;
}

@keyframes bobbing {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    25% {
        transform: translate(-50%, -60%);
    }
    75% {
        transform: translate(-50%, -40%);
    }
}

@keyframes yankBobber {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    30% {
        transform: translate(-50%, -70%) scale(1.5) rotate(-10deg);
    }
    50% {
        transform: translate(-50%, -75%) scale(1.6) rotate(10deg);
    }
    70% {
        transform: translate(-50%, -70%) scale(1.4) rotate(-5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.bait-status {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.worm-indicator {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    display: none;
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% {
        transform: translateY(-50%) rotate(-5deg);
    }
    25% {
        transform: translateY(-50%) rotate(5deg);
    }
    50% {
        transform: translateY(-50%) rotate(-5deg);
    }
    75% {
        transform: translateY(-50%) rotate(5deg);
    }
}

.pole-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.pole-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: scale(1.05);
}

.pole-btn.active {
    background: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

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

/* Fisherman Controls */
.fisherman-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.fisherman-controls button {
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

#checkBaitBtn {
    background: #2196F3;
    color: white;
}

#checkBaitBtn:hover:not(:disabled) {
    background: #1976D2;
}

#setHookBtn {
    background: #ff5722;
    color: white;
    font-weight: bold;
}

#setHookBtn:hover:not(:disabled) {
    background: #e64a19;
    transform: scale(1.1);
}

#dropLineBtn {
    background: #9c27b0;
    color: white;
}

#dropLineBtn:hover:not(:disabled) {
    background: #7b1fa2;
}

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

/* Underwater View */
.underwater-view {
    background: linear-gradient(180deg, #006994 0%, #003d5c 100%);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    min-height: 300px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

.underwater-holes {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.underwater-hole {
    position: relative;
    width: 120px;
    height: 200px;
}

.hook-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 150px;
    background: linear-gradient(180deg, #666 0%, #999 100%);
    transform: translateX(-50%);
}

.bait {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s;
}

.bait:hover:not([style*="pointer-events: none"]) {
    transform: translateX(-50%) scale(1.2);
}

.bait.danger {
    animation: danger-pulse 0.5s ease-in-out;
}

.bait.hook-set {
    animation: hookPull 0.5s ease-out;
}

@keyframes danger-pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        filter: brightness(1.5) saturate(2);
    }
}

@keyframes hookPull {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    30% {
        transform: translateX(-50%) translateY(-80px) rotate(-15deg);
    }
    50% {
        transform: translateX(-50%) translateY(-100px) rotate(15deg);
    }
    70% {
        transform: translateX(-50%) translateY(-60px) rotate(-10deg);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

.bait-icon {
    font-size: 2.5rem;
    display: block;
}

.bait-count {
    display: block;
    background: white;
    color: #333;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 5px;
}

.fish-sprite {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    transition: all 0.8s ease-in-out;
}

.fish-sprite.idle {
    animation: swim 8s ease-in-out infinite;
}

@keyframes swim {
    0%, 100% {
        left: 20%;
    }
    50% {
        left: 80%;
    }
}

.fish-sprite.nibbling-0 {
    left: 20%;
    bottom: 100px;
    animation: hover 0.5s ease-in-out infinite;
}

.fish-sprite.nibbling-1 {
    left: 50%;
    bottom: 100px;
    animation: hover 0.5s ease-in-out infinite;
}

.fish-sprite.nibbling-2 {
    left: 80%;
    bottom: 100px;
    animation: hover 0.5s ease-in-out infinite;
}

@keyframes hover {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.status-message {
    min-height: 30px;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 15px;
}

.bait-remaining {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4CAF50;
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

/* Hungry Timer */
.hungry-timer-container {
    text-align: center;
    margin: 20px 0;
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 15px;
    display: inline-block;
}

.hungry-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.hungry-timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4CAF50;
    transition: all 0.3s ease;
}

.hungry-timer.warning {
    color: #ff5722;
    font-size: 3.5rem;
    animation: pulse 0.5s ease-in-out infinite;
}

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

.hungry-warning {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Ice Fishing Victory Animations */
.victory-animation, .defeat-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    text-align: center;
    pointer-events: none;
}

.victory-fish, .defeat-plate, .defeat-sad {
    font-size: 8rem;
    animation: zoomBounce 1.5s ease-out;
}

.victory-text, .defeat-text {
    font-size: 3rem;
    font-weight: bold;
    margin-top: 20px;
    animation: fadeInScale 1.5s ease-out;
}

.victory-text {
    color: #4CAF50;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

.defeat-text {
    color: #ff5722;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
}

/* Special color for fisherman's no luck message */
#fishermanDefeat .defeat-text {
    color: #2196F3;
}

@keyframes zoomBounce {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.5) rotate(10deg);
        opacity: 1;
    }
    60% {
        transform: scale(0.9) rotate(-5deg);
    }
    80% {
        transform: scale(1.1) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Rummy Game */
.deck-and-discard {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 30px;
}

.deck-area, .discard-area {
    text-align: center;
}

.draw-deck {
    position: relative;
    width: 100px;
    height: 140px;
    margin-top: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

.draw-deck:hover {
    transform: scale(1.05);
}

.card-back {
    width: 100px;
    height: 140px;
    background: linear-gradient(45deg, #2c3e50 25%, #34495e 25%, #34495e 50%, #2c3e50 50%, #2c3e50 75%, #34495e 75%, #34495e);
    background-size: 20px 20px;
    border: 2px solid #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.deck-count {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
}

.discard-pile {
    position: relative;
    width: 100px;
    height: 140px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

#topDiscard {
    position: absolute;
    width: 80px;
    height: 120px;
    font-size: 1.5rem;
}

#topDiscard:empty {
    display: none;
}

.card.clickable {
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card.clickable:hover {
    transform: translateY(-10px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background: #fffbf0;
}

#rummyCards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

#rummyCards .card {
    width: 70px;
    height: 100px;
    font-size: 1.3rem;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

#rummyCards .card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

#rummyCards .card.newly-drawn {
    animation: blinkCard 0.5s ease-in-out 2;
}

@keyframes blinkCard {
    0%, 100% {
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    50% {
        background: #ffeb3b;
        box-shadow: 0 0 20px rgba(255, 235, 59, 0.8);
        transform: scale(1.1);
    }
}

#drawControls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

#drawControls button {
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

#drawControls button:first-child {
    background: #2196F3;
    color: white;
}

#drawControls button:first-child:hover {
    background: #1976D2;
    transform: scale(1.05);
}

#drawControls button:last-child {
    background: #ff9800;
    color: white;
}

#drawControls button:last-child:hover {
    background: #f57c00;
    transform: scale(1.05);
}

#discardControls {
    text-align: center;
    background: #fff3e0;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#discardControls p {
    font-size: 1.1rem;
    color: #e65100;
    font-weight: bold;
}

.rummy-help {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.rummy-help h4 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.rummy-help ul {
    list-style: none;
    padding-left: 0;
}

.rummy-help li {
    padding: 5px 0;
    color: #555;
}

.rummy-help strong {
    color: #2e7d32;
}

#rummyLog {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 20px;
}

#rummyLog p {
    margin-bottom: 5px;
    padding: 5px;
    background: white;
    border-radius: 5px;
}

#rummyLog .win-message {
    background: #4CAF50;
    color: white;
    font-size: 1.2rem;
    padding: 10px;
    text-align: center;
}

/* Dots and Boxes Game Styles */
.dots-game-area {
    display: flex;
    gap: 2rem;
    padding: 1rem;
}

.dots-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.player-identifiers {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 300px;
}

.player-identifiers h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1rem;
}

#playerIdentifiersList {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.identifier-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.identifier-box {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: white;
    border: 2px solid #2196F3;
    border-radius: 4px;
    font-weight: bold;
    color: #2196F3;
}

.dots-grid-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.dots-grid {
    cursor: default;
}

.game-dot {
    transition: all 0.2s ease;
}

.game-dot:hover {
    filter: brightness(1.2);
}

.selected-dot {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { r: 8; }
    50% { r: 10; }
    100% { r: 8; }
}

.game-line {
    stroke-linecap: round;
    animation: drawLine 0.3s ease-out;
}

@keyframes drawLine {
    from {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.game-box {
    animation: fadeIn 0.3s ease-out;
}

.box-identifier {
    animation: popIn 0.3s ease-out;
}

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

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

.dots-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dots-sidebar .players-scores {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dots-sidebar .players-scores h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

#dotsPlayersScores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-score-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.player-score-item.current-turn {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.player-score-item .score {
    font-weight: bold;
    color: #2196F3;
}

#dotsGameLog {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
}

#dotsGameLog h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

#dotsLogEntries {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-entry {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    color: #666;
    border-left: 2px solid #ddd;
    padding-left: 0.5rem;
}

.log-entry.box-completed {
    color: #4CAF50;
    border-left-color: #4CAF50;
    font-weight: bold;
}

.dots-notice {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f44336;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
}

.dots-notice.flash {
    animation: flashNotice 0.5s ease-out;
}

@keyframes flashNotice {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .room-options {
        grid-template-columns: 1fr;
    }
    
    .divider {
        display: none;
    }
    
    .game-sidebar {
        grid-template-columns: 1fr;
    }
    
    #drawCanvas {
        width: 100%;
        height: auto;
    }
    
    .ice-holes {
        flex-direction: column;
        align-items: center;
    }
    
    .underwater-holes {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
}
