/* ==========================================================================
   Cookie Monopoly Game Specific Styles (Grand Overhaul)
   ========================================================================== */
   
:root {
    --bg-sky: #a8e6cf;
    --board-grass: #a0e363;
    --board-border: #523118;
    --cell-pink: #ffaed0;
    --cell-blue: #9ad5ff;
    --cell-yellow: #ffec8b;
    --cell-orange: #ffbfa3;
    --text-dark: #3a1c0d;
    --btn-pink: #ff3385;
}

#game-panel-monopoly {
    font-family: 'Mali', cursive;
    background: radial-gradient(circle at top, #def9ff 0%, #a4e4ff 100%);
    background-image: url('https://www.transparenttextures.com/patterns/candy-hole.png'), radial-gradient(circle at top, #def9ff 0%, #a4e4ff 100%);
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Setup Screen */
.monopoly-setup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    max-width: 800px;
    margin: 0 auto;
    border: 8px solid var(--text-dark);
}

.monopoly-setup-container h1 {
    color: var(--btn-pink);
    font-size: 3.5rem;
    text-shadow: -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white, 2px 2px 0 white, 4px 4px 0 rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.cookie-avatar-select {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px;
}

.cookie-avatar-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid #fff;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f2f6;
}

.cookie-avatar-option.selected {
    border-color: var(--btn-pink);
    transform: scale(1.2);
    background: #fff0f6;
    box-shadow: 0 10px 20px rgba(255, 159, 243, 0.5);
}

/* Game Layout */
.monopoly-board-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100%;
    min-height: 80vh;
    padding: 20px;
    box-sizing: border-box;
    gap: 20px;
}

/* --- Main Board --- */
.main-board-area {
    flex: 1;
    background-image: url('monopoly_bg.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 40px;
    border: 12px solid var(--board-border);
    box-shadow: 0 20px 30px rgba(0,0,0,0.3);
    position: relative;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
}

/* --- Cookie Sprites --- */
.cookie-sprite {
    background-image: url('monopoly_chars.png');
    background-size: 400% 200%;
    background-repeat: no-repeat;
    display: inline-block;
}
.cookie-sprite-0 { background-position: 0% 0%; }
.cookie-sprite-1 { background-position: 33.33% 0%; }
.cookie-sprite-2 { background-position: 66.66% 0%; }
.cookie-sprite-3 { background-position: 100% 0%; }
.cookie-sprite-4 { background-position: 0% 100%; }
.cookie-sprite-5 { background-position: 33.33% 100%; }
.cookie-sprite-6 { background-position: 66.66% 100%; }
.cookie-sprite-7 { background-position: 100% 100%; }

/* --- Sidebar (Right) --- */
.monopoly-sidebar {
    width: 160px;
    background: var(--board-border);
    border-radius: 30px;
    border: 6px solid #361b0c;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 80vh;
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
}

.char-card {
    background: #734628;
    border-radius: 20px;
    padding: 10px 5px;
    text-align: center;
    color: white;
    font-size: 0.95rem;
    border: 3px solid #361b0c;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: bold;
    box-shadow: inset 0 3px 0 rgba(255,255,255,0.1), 0 5px 10px rgba(0,0,0,0.2);
}
.char-card.active {
    background: #ffebb3;
    color: var(--text-dark);
    transform: scale(1.1);
    border-color: #ffaa00;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6), inset 0 3px 0 rgba(255,255,255,0.6);
}
.char-emoji { font-size: 2.8rem; margin-bottom: 5px; }

/* --- Cells --- */
.cell {
    position: absolute;
    width: 10%;
    height: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    text-shadow: 2px 2px 0 white, -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white;
    z-index: 5;
    /* Invisible background, we only want the text on top of the image */
    background: transparent;
    border: none;
    box-shadow: none;
}
/* Override specific background colors since we don't need them anymore */
.c-pink, .c-blue, .c-yellow, .c-orange, .cell-start { background-color: transparent !important; }
.cell-start { font-size: 1.2rem; }

/* --- Center Area --- */
.center-area {
    grid-column: 2 / 7;
    grid-row: 2 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    position: relative;
}

.deck {
    width: 140px;
    height: 190px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    border: 5px solid white;
    border-radius: 15px;
    box-shadow: -3px 3px 0px #ffcce0, -6px 6px 0px #cce0ff, -9px 9px 0px #ffebb3, -12px 12px 0px #bced74, 0 20px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: bold;
    color: #e84393;
    text-align: center;
    transform: rotate(-10deg);
    cursor: pointer;
    transition: transform 0.2s;
    text-shadow: 1px 1px 0 white;
}

.deck:hover {
    transform: rotate(-5deg) translateY(-10px);
}

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

.dice-display {
    font-size: 5rem;
    width: 120px;
    height: 120px;
    background: linear-gradient(to bottom, #ffffff, #f0f0f0);
    border-radius: 25px;
    border: 5px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -8px 0 rgba(0,0,0,0.1), 0 15px 20px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    color: var(--text-dark);
    transition: transform 0.1s;
}

.roll-btn-circle {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #ff66a3, var(--btn-pink));
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 12px 0 #cc0052, 0 20px 30px rgba(0,0,0,0.4), inset 0 10px 10px rgba(255,255,255,0.4);
    color: white;
    font-size: 1.8rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    line-height: 1.2;
    text-shadow: 2px 2px 0 #cc0052;
}
.roll-btn-circle:active {
    transform: translateY(12px);
    box-shadow: 0 0px 0 #cc0052, 0 5px 10px rgba(0,0,0,0.4), inset 0 5px 10px rgba(255,255,255,0.2);
}

.roll-btn-circle.disabled {
    background: #ccc;
    box-shadow: 0 12px 0 #999;
    cursor: not-allowed;
    text-shadow: none;
}

.turn-info {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--board-border);
    color: white;
    padding: 10px 40px;
    border-radius: 30px;
    font-size: 1.6rem;
    font-weight: bold;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 4px solid #fff;
    white-space: nowrap;
}

/* --- Tokens --- */
.token {
    position: absolute;
    width: 60px;
    height: 60px; /* bigger tokens */
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    filter: drop-shadow(0 10px 5px rgba(0,0,0,0.4));
    transform-origin: bottom center;
}

/* Idle animation */
@keyframes bounceIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.05); }
}
.token.idle {
    animation: bounceIdle 2s infinite;
}

/* Rolling animation for dice */
@keyframes superRoll {
    0% { transform: rotate(0deg) scale(1) translateY(0); }
    25% { transform: rotate(90deg) scale(1.2) translateY(-30px); }
    50% { transform: rotate(180deg) scale(1.1) translateY(-10px); }
    75% { transform: rotate(270deg) scale(1.2) translateY(-30px); }
    100% { transform: rotate(360deg) scale(1) translateY(0); }
}
.dice-display.rolling {
    animation: superRoll 0.4s infinite;
}

/* Custom SweetAlert styles to make them cute */
.monopoly-swal-popup {
    border-radius: 30px !important;
    border: 8px solid var(--text-dark) !important;
    font-family: 'Mali', cursive !important;
}
.monopoly-swal-title {
    color: var(--btn-pink) !important;
    font-size: 2.5rem !important;
}
