

@import url('./relationships.css');

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #eef2f7; /* Light mode background */
}

/* For Telegram dark mode */
html.dark body {
  background-color: #1a202c; /* Dark mode background */
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Pre-React Loader Styles */
.app-loader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #0d1117;
  color: #a0aec0; /* gray-500 */
}

.app-loader p {
  margin-top: 1rem;
  font-size: 0.875rem; /* text-sm */
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #4a5568; /* gray-600 */
  border-top: 4px solid #4299e1; /* blue-400 */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* --- NEW SIDE JOB STYLES --- */

/* Cashier Game */
.cashier-scene {
    flex-grow: 1;
    position: relative;
    background: linear-gradient(to top, #4a5568 0%, #718096 100%);
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    overflow: hidden;
    min-height: 250px; /* FIX: Ensure container has height */
}
.cashier-desk {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background-color: #78350f;
    border-top: 5px solid #522100;
}
.cashier-scanner {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 60px;
    background-color: #cbd5e0;
    border-radius: 5px;
    border: 2px solid #a0aec0;
}
.scanner-light {
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 4px;
    background-color: red;
    box-shadow: 0 0 10px red;
    opacity: 0;
    animation: scan-beam 0.8s ease-in-out;
}
.cashier-bag {
    position: absolute;
    bottom: 10px;
    right: 10%;
    font-size: 4rem;
    transform: scale(0.8);
}
.cashier-bag::before {
    content: '🛍️';
}
.scanner-product {
    position: absolute;
    bottom: 40%;
    left: -10%;
    font-size: 2.5rem;
    animation: scan-product 0.8s ease-in-out forwards;
}
@keyframes scan-product {
    0% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(180px, 0) scale(1); }
    50% { transform: translate(200px, 0) scale(1.1); }
    100% { transform: translate(300px, 100px) scale(0.2); opacity: 0;}
}
@keyframes scan-beam {
    40% { opacity: 0; }
    50% { opacity: 1; }
    60% { opacity: 0; }
}

/* Govnovoz Game */
.govnovoz-road {
    flex-grow: 1;
    background-color: #4a5568;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
    min-height: 250px; /* FIX: Ensure container has height */
}
.road-markings {
    position: absolute;
    top: 0;
    left: 33.33%;
    width: 4px;
    height: 200%;
    background-image: linear-gradient(to bottom, yellow 50%, transparent 50%);
    background-size: 100% 40px;
    animation: move-road 0.5s linear infinite;
}
.road-markings::after {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 30%;
    width: 4px;
    height: 100%;
    background-image: linear-gradient(to bottom, yellow 50%, transparent 50%);
    background-size: 100% 40px;
}
@keyframes move-road {
    from { transform: translateY(-40px); }
    to { transform: translateY(0); }
}
.player-truck {
    position: absolute;
    top: 80%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    transition: left 0.2s ease-out;
}
.car {
    position: absolute;
    font-size: 2.5rem;
    transform: translateX(-50%);
}
.stain {
    position: absolute;
    font-size: 1.5rem;
    transform: translateX(-50%);
}

/* Chimney Sweep Game */
.chimney-maze {
    width: 100%;
    max-width: 320px;
    margin: 0.5rem auto;
    aspect-ratio: 1 / 1;
    background-color: #2d3748; /* Dark wall color */
    position: relative;
    border: 4px solid #4a5568;
}
.maze-pipe {
    position: absolute;
    background-color: #a0aec0; /* Light pipe color */
    width: calc(100% / 15);
    height: calc(100% / 15);
}
.maze-player, .maze-rat, .maze-dot {
    position: absolute;
    width: calc(100% / 15);
    height: calc(100% / 15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(100% / 15 * 2.8); /* Significantly increased icon size */
    transition: top 0.2s linear, left 0.2s linear;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5); /* Added shadow for better visibility */
}
.maze-dot::before {
    content: '';
    display: block;
    width: 30%;
    height: 30%;
    background-color: #1a202c; /* Soot color */
    border-radius: 50%;
}

/* Hunter Game Animations */
@keyframes fly-left { 
    0% { 
        left: 100%; 
    } 
    100% { 
        left: -10%; 
    } 
}

@keyframes fly-right { 
    0% { 
        left: -10%; 
    } 
    100% { 
        left: 100%; 
    } 
}

/* Duck shooting animation */
@keyframes duck-shot {
    0% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.7;
    }
    100% { 
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.duck-shot {
    animation: duck-shot 0.3s ease-out forwards;
}


/* Janitor Game Styles */

.game-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}

.game-modal-content {
    background-color: #1a202c; /* dark:bg-gray-800 */
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #4a5568; /* gray-600 */
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.3s ease-out forwards;
    max-height: calc(100vh - 32px); /* 100vh - padding (16px * 2) */
    overflow-y: auto;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(30, 1fr);
    grid-template-rows: repeat(30, 1fr);
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border: 2px solid #4a5568; /* gray-600 */
    background-color: #2d3748; /* gray-800 */
    touch-action: none; /* prevent scrolling on mobile */
}

.grid-cell {
    position: relative;
    width: 100%;
    height: 100%;
}

.cell-ground { background-color: #9AE6B4; }
.cell-road { background-color: #E2E8F0; }
.cell-building { background-color: #718096; }

html.dark .cell-ground { background-color: #38A169; }
html.dark .cell-road { background-color: #4A5568; }
html.dark .cell-building { background-color: #1A202C; border: 1px solid #2D3748; }


.cell-player::after {
    content: '🧹';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    line-height: 1;
}
.cell-trash::before {
    content: '🗑️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    line-height: 1;
}

/* Loader Game Styles */

.loader-game-grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr); /* Wider grid */
    grid-template-rows: repeat(10, 1fr);    /* Shorter grid */
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 2 / 1; /* Match grid ratio */
    border: 2px solid #4a5568; /* gray-600 */
    background-color: #A0AEC0; /* gray-400 */
    touch-action: none;
}

html.dark .loader-game-grid {
    background-color: #2D3748; /* gray-700 */
}

.loader-grid-cell {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid #CBD5E0; /* gray-300 */
}

html.dark .loader-grid-cell {
    border-color: #4A5568; /* gray-600 */
}

.cell-container-zone { background-color: rgba(237, 137, 54, 0.4); } /* orange-400 with opacity */
.cell-truck-zone { background-color: rgba(74, 85, 104, 0.6); } /* gray-600 with opacity */

.cell-container-zone::before {
    content: '📦';
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

.cell-truck-zone::before {
    content: '🚚';
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
}

.cell-player-loader::after {
    content: '🚶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    line-height: 1;
}
.cell-player-loader-carrying::after {
    content: '🚶📦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    line-height: 1;
}

/* Kindergarten Game Styles */
.kindergarten-game-grid {
    position: relative; /* Needed for absolute positioning of the player */
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    grid-template-rows: repeat(15, 1fr);
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 25 / 15;
    border: 2px solid #4a5568;
    background-color: #A0AEC0;
    touch-action: none;
}
html.dark .kindergarten-game-grid {
    background-color: #2D3748;
}

.kg-player {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: top 0.1s linear, left 0.1s linear; /* Smooth movement */
    white-space: nowrap; /* Prevent emoji wrapping */
    z-index: 10;
}

.kg-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

/* Backgrounds */
.kg-cell-wall { 
    background-color: #718096; 
}
.kg-cell-play { 
    background-color: #FEEBC8; 
}
.kg-cell-sleep { 
    background-color: #C3DAFE; 
}

html.dark .kg-cell-wall { 
    background-color: #2D3748; 
    border: 1px solid #4A5568; 
}
html.dark .kg-cell-play { 
    background-color: #4A5568; 
}
html.dark .kg-cell-sleep { 
    background-color: #2C5282; 
}

/* Special styling for specific content */
.kg-cell-bed-empty {
    font-size: 14px;
    opacity: 0.7;
}
.kg-cell-bed-occupied {
    font-size: 14px;
    opacity: 1;
}

/* Accountant Game (Tetris) Styles */
.accountant-game-container {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Reduced gap */
    width: 100%;
    height: 100%; /* Fill parent */
    flex-shrink: 1;
    min-height: 0;
}

.accountant-game-grid-wrapper {
    flex-grow: 1; /* Take up all available vertical space */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0; /* Crucial for flex sizing */
}

.accountant-game-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    width: auto; /* Allow width to be determined by height */
    height: 100%; /* Fit the wrapper's height */
    aspect-ratio: 10 / 20; /* Force correct proportions */
    border: 2px solid #4a5568;
    background-color: #2d3748;
}

.accountant-grid-cell {
    aspect-ratio: 1 / 1; 
    border-right: 1px solid #4a5568;
    border-bottom: 1px solid #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: #f5f5dc;
}

.accountant-game-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    color: white;
    font-size: 0.8rem;
    flex-shrink: 0; /* Prevent info from shrinking */
}

.info-box {
    background-color: #4a5568;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    width: 100%;
}

.next-piece-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 80px;
    margin: 4px auto 0;
    background-color: #2d3748;
    border-radius: 4px;
}

.next-piece-grid .accountant-grid-cell {
    border: none;
    font-size: 11px;
}

.accountant-drop-button {
  padding: 6px;
}
/* Controls override for a more balanced UI */
.accountant-game-container .game-controls {
    gap: 6px;
}
.accountant-game-container .control-button {
    padding: 6px;
    font-size: 1.1rem;
}
.accountant-game-container .finish-work-button {
    padding: 6px;
    margin-top: 0; /* Rely on parent flex gap */
}

/* Casino Styles */
.casino-game-button {
    background-color: #2d3748;
    border: 1px solid #4a5568;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease-in-out;
}
.casino-game-button:hover {
    background-color: #4a5568;
    border-color: #718096;
    transform: translateY(-2px);
}
.casino-game-button:active {
    transform: translateY(0);
}

.casino-game-title {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: #fff;
    margin-bottom: 8px;
}

.casino-message-box {
    background-color: #2d3748;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    color: #cbd5e0;
    font-size: 0.875rem;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Betting Controls */
.casino-bet-input {
    background-color: #4a5568;
    color: #fff;
    border: 1px solid #718096;
    border-radius: 6px;
    padding: 10px;
    font-size: 1rem;
    text-align: center;
}
.casino-bet-input:disabled {
    opacity: 0.6;
}

.casino-bet-modifier-button {
    background-color: #4a5568;
    color: #fff;
    border: 1px solid #718096;
    border-radius: 6px;
    padding: 10px;
    font-weight: bold;
    transition: background-color 0.2s;
}
.casino-bet-modifier-button:hover:not(:disabled) {
    background-color: #718096;
}
.casino-bet-modifier-button:disabled {
    opacity: 0.6;
}

.casino-action-button {
    background-color: #2b6cb0;
    color: #fff;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
}
.casino-action-button:hover:not(:disabled) {
    background-color: #2c5282;
}
.casino-action-button:active:not(:disabled) {
    transform: scale(0.98);
}
.casino-action-button:disabled {
    background-color: #4a5568;
    cursor: not-allowed;
    opacity: 0.7;
}

.finish-work-button {
    width: 100%;
    background-color: #4a5568;
    color: #e2e8f0;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    transition: background-color 0.2s;
}
.finish-work-button:hover {
    background-color: #718096;
}

/* Slots Game Styles */
.slots-machine {
    background: linear-gradient(145deg, #1a202c, #2d3748);
    border: 4px solid #a0aec0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.slots-reels {
    display: flex;
    justify-content: center;
    gap: 12px;
    border: 2px solid #1a202c;
    background: #0d1117;
    padding: 10px;
    border-radius: 8px;
    overflow: hidden;
}
.slot-reel {
    width: 60px;
    height: 60px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.reel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.slot-reel.spinning .reel-inner {
    animation: spin-reel 0.2s linear infinite;
}
@keyframes spin-reel {
    from { transform: translateY(-120px); }
    to { transform: translateY(0); }
}
.slot-symbol {
    width: 60px;
    height: 60px;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.payout-table {
    background-color: rgba(45, 55, 72, 0.5);
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    color: #a0aec0;
}
.payout-table-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 4px;
    color: #e2e8f0;
}
.payout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
    text-align: center;
}


/* Blackjack Game Styles */
.blackjack-table {
    background-color: #2f855a;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 250px;
}
.hand-area {
    min-height: 80px;
}
.hand-label {
    color: #fff;
    font-weight: bold;
    margin-bottom: 4px;
}
.cards-container {
    display: flex;
    gap: -20px; /* Overlap cards */
}
.blackjack-message {
    font-weight: bold;
    background-color: rgba(0,0,0,0.3);
    color: #fff;
}


/* Roulette Game Styles */
.casino-roulette-modal {
    gap: 16px;
}
.simple-roulette-container {
    width: 100%;
    height: 60px;
    background-color: #1a202c;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 2px solid #4a5568;
}
.simple-roulette-pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 64px;
    background-color: #f7fafc;
    z-index: 10;
    box-shadow: 0 0 10px #f7fafc;
}
.simple-roulette-tape {
    height: 100%;
    display: flex;
}
.simple-roulette-block {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.simple-roulette-block.red { background-color: #e53e3e; }
.simple-roulette-block.black { background-color: #2d3748; }
.simple-roulette-block.green { background-color: #38a169; }

.simple-roulette-bet-button {
    color: white;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
}
.simple-roulette-bet-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.simple-roulette-bet-button.red { background-color: #c53030; }
.simple-roulette-bet-button.red:hover:not(:disabled) { background-color: #e53e3e; }
.simple-roulette-bet-button.black { background-color: #2d3748; }
.simple-roulette-bet-button.black:hover:not(:disabled) { background-color: #4a5568; }
.simple-roulette-bet-button.green { background-color: #2f855a; }
.simple-roulette-bet-button.green:hover:not(:disabled) { background-color: #38a169; }
.payout-multiplier {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Dice Game Styles */
.casino-dice-container {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dice {
    width: 80px;
    height: 80px;
}
.dice-face {
    width: 100%;
    height: 100%;
    background-color: #f7fafc;
    border-radius: 12px;
    padding: 10px;
    display: grid;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.dice-dot {
    width: 16px;
    height: 16px;
    background-color: #2d3748;
    border-radius: 50%;
}
/* Grid layouts for dice faces */
.dice-face[data-value="1"] { grid-template-areas: ". . ." ". a ." ". . ."; }
.dice-face[data-value="2"] { grid-template-areas: "a . ." ". . ." ". . b"; }
.dice-face[data-value="3"] { grid-template-areas: "a . ." ". b ." ". . c"; }
.dice-face[data-value="4"] { grid-template-areas: "a . b" ". . ." "c . d"; }
.dice-face[data-value="5"] { grid-template-areas: "a . b" ". c ." "d . e"; }
.dice-face[data-value="6"] { grid-template-areas: "a . b" "c . d" "e . f"; }
.dice-face[data-value="1"] .dice-dot:nth-child(1) { grid-area: a; justify-self: center; align-self: center; }
.dice-face[data-value="2"] .dice-dot:nth-child(1) { grid-area: a; }
.dice-face[data-value="2"] .dice-dot:nth-child(2) { grid-area: b; justify-self: end; align-self: end; }
.dice-face[data-value="3"] .dice-dot:nth-child(1) { grid-area: a; }
.dice-face[data-value="3"] .dice-dot:nth-child(2) { grid-area: b; justify-self: center; align-self: center; }
.dice-face[data-value="3"] .dice-dot:nth-child(3) { grid-area: c; justify-self: end; align-self: end; }
.dice-face[data-value="4"] .dice-dot:nth-child(1) { grid-area: a; }
.dice-face[data-value="4"] .dice-dot:nth-child(2) { grid-area: b; justify-self: end; }
.dice-face[data-value="4"] .dice-dot:nth-child(3) { grid-area: c; align-self: end; }
.dice-face[data-value="4"] .dice-dot:nth-child(4) { grid-area: d; justify-self: end; align-self: end; }
.dice-face[data-value="5"] .dice-dot:nth-child(1) { grid-area: a; }
.dice-face[data-value="5"] .dice-dot:nth-child(2) { grid-area: b; justify-self: end; }
.dice-face[data-value="5"] .dice-dot:nth-child(3) { grid-area: c; justify-self: center; align-self: center; }
.dice-face[data-value="5"] .dice-dot:nth-child(4) { grid-area: d; align-self: end; }
.dice-face[data-value="5"] .dice-dot:nth-child(5) { grid-area: e; justify-self: end; align-self: end; }
.dice-face[data-value="6"] .dice-dot:nth-child(1) { grid-area: a; }
.dice-face[data-value="6"] .dice-dot:nth-child(2) { grid-area: b; justify-self: end; }
.dice-face[data-value="6"] .dice-dot:nth-child(3) { grid-area: c; }
.dice-face[data-value="6"] .dice-dot:nth-child(4) { grid-area: d; justify-self: end; }
.dice-face[data-value="6"] .dice-dot:nth-child(5) { grid-area: e; align-self: end; }
.dice-face[data-value="6"] .dice-dot:nth-child(6) { grid-area: f; justify-self: end; align-self: end; }

.dice-number-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.dice-number-button {
    background-color: #4a5568;
    color: #fff;
    border: 2px solid transparent;
    border-radius: 6px;
    aspect-ratio: 1/1;
    font-weight: bold;
    font-size: 1.25rem;
    transition: all 0.2s;
}
.dice-number-button.selected {
    border-color: #63b3ed;
    background-color: #2b6cb0;
    transform: scale(1.05);
}
.dice-number-button:disabled { opacity: 0.6; }


/* Crash Game Styles */
.casino-crash-modal {
    gap: 12px;
}
.crash-graph-area {
    width: 100%;
    height: 150px;
    background-color: #0d1117;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2d3748;
    position: relative;
    overflow: hidden;
}

.crash-graph-area::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #4a5568, #4a5568 50%, transparent 50%, transparent 100%) 0 0/10px 2px repeat-x;
}
.crash-graph-area::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(0deg, #4a5568, #4a5568 50%, transparent 50%, transparent 100%) 0 0/2px 10px repeat-y;
}


.crash-multiplier-display {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    transition: color 0.3s ease;
}
.crash-multiplier-display.betting { color: #a0aec0; }
.crash-multiplier-display.running { color: #68d391; }
.crash-multiplier-display.crashed { color: #fc8181; }

.crash-history {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px; /* for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}
.crash-history-item {
    background-color: #2d3748;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}
.crash-history-item.win { color: #68d391; }
.crash-history-item.loss { color: #fc8181; }

.cashout-button {
    background-color: #dd6b20; /* orange-600 */
}
.cashout-button:hover:not(:disabled) {
    background-color: #c05621; /* orange-700 */
}


/* Shared Game Controls */
.game-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    grid-template-areas:
        ". up ."
        "left down right";
}
.control-button {
    background-color: #4A5568; /* gray-600 */
    color: #F7FAFC; /* gray-100 */
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
    padding: 12px;
    transition: background-color 0.2s ease;
}
.control-button:hover { background-color: #718096; } /* gray-500 */
.control-button:active { background-color: #2D3748; transform: scale(0.95); } /* gray-700 */

.control-button:nth-child(1) { grid-area: up; }
.control-button:nth-child(2) { grid-area: left; }
.control-button:nth-child(3) { grid-area: right; }
.control-button:nth-child(4) { grid-area: down; }


/* Feedback Popup Styles */
@keyframes feedback-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feedback-popup {
    animation: feedback-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* === NEW POKER STYLES (REWORKED) === */
.poker-modal-content {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 8px;
    gap: 0;
    background-color: #1a202c;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.poker-table-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}
.poker-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    background-color: #2d3748;
    border-radius: 6px;
    color: white;
    flex-shrink: 0;
}
.poker-top-bar h3 {
    font-weight: bold;
    font-size: 0.875rem;
}
.pot-display-top {
    font-size: 0.875rem;
    font-weight: bold;
    color: #ecc94b;
}
.poker-leave-button {
    background: #718096;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}
.poker-leave-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.poker-table-area {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.poker-table-surface {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1.5 / 1;
    background-color: #2f855a;
    border-radius: 50%;
    border: 10px solid #78350f;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.poker-bottom-bar {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #4a5568;
    background-color: #1a202c;
    height: 210px; /* Fixed height to prevent layout shifts */
}
.poker-player-hand-actions {
    flex: 3; /* Takes more space */
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.poker-my-hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px; /* Reserve space for cards */
    perspective: 1000px;
}

.poker-actions-container {
    flex-grow: 1;
}
.poker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.poker-raise-action {
    grid-column: span 2;
}
.poker-action-button {
    color: white;
    font-weight: bold;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s;
}
.poker-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.poker-action-button.fold { background-color: #e53e3e; }
.poker-action-button.check { background-color: #4a5568; }
.poker-action-button.call { background-color: #38a169; }
.poker-action-button.raise { background-color: #2b6cb0; }
.poker-raise-action input[type="range"] {
    width: 100%;
    height: 8px;
    margin-bottom: 2px;
}

.poker-chat-container {
    flex: 2; /* Takes less space */
    display: flex;
    flex-direction: column;
    background-color: #2d3748;
    border-radius: 6px;
    padding: 4px;
}
.poker-chat-log {
    flex-grow: 1;
    overflow-y: auto;
    color: #e2e8f0;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
    min-height: 0; /* Important for flex scrolling */
}
.poker-chat-input {
    width: 100%;
    background-color: #4a5568;
    border: 1px solid #718096;
    color: white;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.875rem;
}
.poker-chat-send {
    background-color: #2b6cb0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 10px;
}

.poker-quick-chip {
    background-color: #4a5568;
    color: #e2e8f0;
    border-radius: 4px;
    padding: 4px;
    transition: background-color 0.2s;
}
.poker-quick-chip:hover {
    background-color: #718096;
}

.poker-player-seat {
    position: absolute;
    width: 20%;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform 0.3s;
}
.poker-player-seat.active {
    transform: scale(1.1) translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));
    filter: drop-shadow(0 0 8px #fef08a);
}
.player-info {
    background-color: rgba(0,0,0,0.6);
    border-radius: 6px;
    padding: 2px 4px;
    text-align: center;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.2);
}
.player-info.folded {
    opacity: 0.5;
    background-color: #4a5568;
}

.player-cards {
    display: flex;
    justify-content: center;
    gap: -20px;
}
.community-cards-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
}

.dealer-button, .blind-button {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    z-index: 10;
}
.dealer-button { background-color: #ecc94b; color: black; }
.blind-button.sb { background-color: #9f7aea; color: white; }
.blind-button.bb { background-color: #4299e1; color: white; }

.player-bet-chip {
    position: absolute;
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border: 1px solid #fff;
    z-index: 5;
}

/* Player seat positioning (0 is local player, not shown here) */
.poker-player-seat[data-seat="1"] { top: 50%; left: 5%; transform: translate(-50%, -50%); }
.poker-player-seat[data-seat="2"] { top: 5%; left: 25%; transform: translate(-50%, -50%); }
.poker-player-seat[data-seat="3"] { top: 5%; left: 75%; transform: translate(-50%, -50%); }
.poker-player-seat[data-seat="4"] { top: 50%; left: 95%; transform: translate(-50%, -50%); }
.poker-player-seat[data-seat="5"] { top: 95%; left: 50%; transform: translate(-50%, -50%); }

.poker-player-seat[data-seat="1"] .player-bet-chip,
.poker-player-seat[data-seat="2"] .player-bet-chip { bottom: -25px; left: 50%; transform: translateX(-50%); }

.poker-player-seat[data-seat="3"] .player-bet-chip,
.poker-player-seat[data-seat="4"] .player-bet-chip { bottom: -25px; left: 50%; transform: translateX(-50%); }

.poker-player-seat[data-seat="5"] .player-bet-chip { top: -25px; left: 50%; transform: translateX(-50%); }

/* New Central Timer Styles */
.poker-info-area {
    text-align: center;
    min-height: 28px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 0 10px;
}
.poker-info-message {
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}
.poker-turn-timer-container {
    width: 60%;
    max-width: 300px;
    height: 5px;
    background-color: rgba(0,0,0,0.4);
    border-radius: 3px;
    overflow: hidden;
    margin: 4px auto 0;
}
.poker-turn-timer-bar {
    height: 100%;
    border-radius: 3px;
    animation-name: turn-timer-depletes;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    transform-origin: left;
}
@keyframes turn-timer-depletes {
  from { transform: scaleX(1); background-color: #68d391; }
  50% { background-color: #fef08a; }
  to { transform: scaleX(0); background-color: #fc8181; }
}

/* === NEW MINIGAME STYLES === */

.minigame-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem auto;
    width: 100%;
    max-width: min(90vw, 350px);
    aspect-ratio: 1 / 1;
}

.minigame-grid-container .minesweeper-grid,
.minigame-grid-container .tictactoe-grid,
.minigame-grid-container .game-2048-board {
    width: 100%;
    height: 100%;
}


/* Minesweeper */
.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    border: 2px solid #718096;
}
.mine-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4a5568;
    border: 1px solid #2d3748;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}
.mine-cell:hover { background-color: #718096; }
.mine-cell.revealed {
    background-color: #a0aec0;
    cursor: default;
}
.mine-cell.revealed:hover { background-color: #a0aec0; }
.mine-cell.mine { background-color: #e53e3e; }
.mine-cell [data-mines="1"] { color: #63b3ed; }
.mine-cell [data-mines="2"] { color: #48bb78; }
.mine-cell [data-mines="3"] { color: #f56565; }
.mine-cell [data-mines="4"] { color: #9f7aea; }
.mine-cell [data-mines="5"] { color: #ed8936; }
.mine-cell [data-mines="6"] { color: #4fd1c5; }
.mine-cell [data-mines="7"] { color: #f6e05e; }
.mine-cell [data-mines="8"] { color: #d53f8c; }


/* Hangman */
.hangman-figure {
    stroke: #e2e8f0;
    stroke-width: 4px;
    stroke-linecap: round;
}
.hangman-word {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.hangman-letter {
    width: 24px;
    border-bottom: 3px solid #cbd5e0;
    text-align: center;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    line-height: 1;
    min-height: 32px;
}
.hangman-keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
    gap: 4px;
}
.keyboard-btn {
    background-color: #4a5568;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 4px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
}
.keyboard-btn:hover:not(:disabled) { background-color: #718096; }
.keyboard-btn:disabled { background-color: #2d3748; opacity: 0.5; cursor: not-allowed; }


/* Tic-Tac-Toe */
.tictactoe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    background-color: #4a5568;
    padding: 8px;
    border-radius: 8px;
}
.tictactoe-cell {
    background-color: #2d3748;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
}
.tictactoe-cell.x { color: #63b3ed; }
.tictactoe-cell.o { color: #f6e05e; }


/* 2048 Game */
.game-2048-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    background-color: #4a5568;
    padding: 8px;
    border-radius: 8px;
    position: relative;
}
.game-2048-cell {
    background-color: #718096;
    border-radius: 4px;
}
.game-2048-tile-container {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
}
.game-2048-tile {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
    color: white;
    font-size: 1.5rem;
    width: calc(25% - 6px);
    height: calc(25% - 6px);
    transition: top 0.15s ease-in-out, left 0.15s ease-in-out;
}
.game-2048-tile[data-value="2"] { background-color: #a0aec0; color: #1a202c;}
.game-2048-tile[data-value="4"] { background-color: #90cdf4; color: #1a202c;}
.game-2048-tile[data-value="8"] { background-color: #f6ad55; }
.game-2048-tile[data-value="16"] { background-color: #f56565; }
.game-2048-tile[data-value="32"] { background-color: #ed64a6; }
.game-2048-tile[data-value="64"] { background-color: #9f7aea; }
.game-2048-tile[data-value="128"] { background-color: #667eea; }
.game-2048-tile[data-value="256"] { background-color: #4fd1c5; }
.game-2048-tile[data-value="512"] { background-color: #48bb78; }
.game-2048-tile[data-value="1024"] { background-color: #f6e05e; }
.game-2048-tile[data-value="2048"] { background-color: #dd6b20; }
.game-2048-tile[data-value="4096"] { background-color: #d53f8c; }


/* Coin Flip */
.coin-container {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
}
.coin {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(.45,.05,.55,.95);
}
.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
}
.coin-heads {
    background: linear-gradient(45deg, #f6e05e, #ecc94b);
    color: #9c4221;
}
.coin-tails {
    background: linear-gradient(45deg, #cbd5e0, #a0aec0);
    color: #2d3748;
    transform: rotateY(180deg);
}

/* Admin Panel Styles */
.admin-button {
    padding: 8px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    transition: opacity 0.2s;
}
.admin-button:hover {
    opacity: 0.85;
}

/* Customization Styles */
.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block; /* Required for background to apply correctly */
    background-color: transparent; /* Fix for potential background color issues */
}

.rainbow-text-animated {
    animation: rainbow-animation 5s linear infinite;
    background-image: linear-gradient(to right, #ef4444, #f97316, #eab308, #84cc16, #22c55e, #14b8a6, #06b6d4, #3b82f6, #8b5cf6, #d946ef, #ef4444);
    background-size: 200% auto;
}

@keyframes rainbow-animation {
    from {
        background-position: 0% center;
    }
    to {
        background-position: -200% center;
    }
}

/* === NEW SIMPLIFIED CARD STYLES === */
.card, .player-card, .durak-card {
    position: relative;
    font-weight: bold;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.4);
    border-radius: 6px;
    border: 1px solid #1a202c;
    background-color: #fff;
    color: #1a202c;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Card Sizes */
.card { /* Blackjack card */
    width: 50px;
    height: 70px;
    padding: 4px;
}
.durak-card {
    width: 48px;
    height: 64px;
}
.player-card { /* Poker card sizes */
    width: 28px;
    height: 40px;
    font-size: 0.9rem;
    padding: 2px;
}
.player-card.community {
    width: 32px;
    height: 46px;
    font-size: 1.1rem;
}
.player-card.my-card {
    width: 45px;
    height: 63px;
    font-size: 1.5rem;
}

/* Card Content (Rank & Suit) */
.card-rank { font-size: 1.25rem; }
.card-suit { font-size: 1rem; position: absolute; bottom: 4px; right: 4px; }
.player-card { /* Poker cards just have text */
    line-height: 1;
}
.durak-card .rank { font-size: 1.1rem; }
.durak-card .suit { font-size: 0.9rem; }


/* Card Color */
.card.red-card, .player-card.red, .durak-card.red { color: #e53e3e; }


/* Hidden Card Style */
.card.is-hidden, .player-card.is-hidden {
    background-color: #4a5568;
    background-image:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 1px, transparent 1.5px),
        repeating-linear-gradient(45deg, #c53030, #c53030 4px, transparent 4px, transparent 8px),
        repeating-linear-gradient(-45deg, #c53030, #c53030 4px, transparent 4px, transparent 8px);
    background-size: 8px 8px, 100% 100%, 100% 100%;
    border: 2px solid #fff;
    color: transparent; /* Hides rank/suit text */
}
/* Ensure hidden cards don't show rank/suit even if they are in the DOM */
.card.is-hidden > *, .player-card.is-hidden > *, .durak-card.is-hidden > * {
    display: none;
}
.player-card.is-hidden {
    font-size: 0; /* Also hide direct text content for poker cards */
}


/* New simplified deal animation */
@keyframes deal-card-animation {
  from {
    opacity: 0;
    transform: translateY(-150px) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-deal-enter {
  animation: deal-card-animation 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-fill-mode: backwards;
}