:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --accent-primary: #38bdf8;
    /* Sky blue */
    --accent-secondary: #818cf8;
    /* Indigo */
    --accent-x: #f472b6;
    /* Pink */
    --accent-o: #34d399;
    /* Emerald */
    --accent-gold: #fbbf24;
    /* Amber/Gold */
    --accent-red: #ef4444;
    /* Red */
    --accent-green: #2ecc71;
    /* Green */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --tile-size: 100px;
    --gap: 15px;
}

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

html {
    min-height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to prevent top cutoff */
    position: relative;
    padding: 2rem 0;
    /* Add padding for breathing room */
    /* Removed overflow-y: auto to let window scroll naturally */
}

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

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

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: -2s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-x);
    top: 40%;
    left: 60%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

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

/* Game Container */
.game-container {
    text-align: center;
    z-index: 1;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.game-header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.status-display {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #cbd5e1;
}

.current-player {
    font-weight: 600;
    color: var(--text-color);
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: var(--gap);
    margin-bottom: 2rem;
    justify-content: center;
}

.tile {
    width: var(--tile-size);
    height: var(--tile-size);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tile:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.tile.x {
    color: var(--accent-x);
    text-shadow: 0 0 15px rgba(244, 114, 182, 0.5);
}

.tile.o {
    color: var(--accent-o);
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
}

.tile.taken {
    cursor: not-allowed;
}

/* Controls */
.btn-reset {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn-reset:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.btn-reset:active {
    transform: scale(0.95);
}

/* Winning Message Overlay */
.winning-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 3rem;
    color: white;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.winning-message.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.winning-message button {
    font-size: 1.5rem;
    background-color: white;
    border: 1px solid black;
    padding: .5em 1em;
    cursor: pointer;
    border-radius: 12px;
    margin-top: 20px;
    font-family: inherit;
    color: var(--bg-color);
    font-weight: 700;
    border: none;
    transition: transform 0.2s;
}

.winning-message button:hover {
    transform: scale(1.05);
    background-color: #f1f5f9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Setup Screen */
.setup-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    transition: opacity 0.5s ease;
}

.setup-screen.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.setup-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.setup-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--accent-primary);
}

.btn-start {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(56, 189, 248, 0.4);
}

.btn-skip {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-name {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Responsive */
@media (max-width: 400px) {
    :root {
        --tile-size: 80px;
        --gap: 10px;
    }

    .game-container {
        padding: 1.5rem;
        width: 95%;
    }

    .scoreboard {
        gap: 1rem;
    }
}

/* App Views & Navigation */
/* App Views & Navigation */
.app-view {
    width: 100%;
    min-height: 100vh;
    position: relative;
    /* Changed from absolute to relative for scrolling */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to prevent top cutoff */
    padding: 80px 20px 20px;
    /* Added top padding */
}

.app-view.hidden {
    display: none;
    /* Use display none to remove from flow */
}

.btn-home {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    z-index: 100;
}

.btn-home:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

/* Home Screen */
.home-content {
    text-align: center;
    z-index: 1;
}

.brand-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    font-weight: 600;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shine 3s infinite linear;
    background-size: 200% auto;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.home-content h1 {
    font-size: 3rem;
    margin-bottom: 3rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.app-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.app-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.app-card h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.app-card p {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Water Tracker Styles */
.water-container {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    text-align: center;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.water-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--accent-primary), #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#currentDate {
    color: #94a3b8;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Section Divider */
.section-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    flex: 1;
    margin: 0 1rem;
}

.progress-circle-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 534;
    /* 2 * PI * r (85) */
    stroke-dashoffset: 534;
    stroke-linecap: round;
}

.progress-ring__circle-excess {
    transition: stroke-dashoffset 0.5s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    stroke-linecap: round;
    pointer-events: none;
    /* Let clicks pass through */
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#currentWater {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.unit {
    font-size: 1rem;
    color: #94a3b8;
}

.goal-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

.water-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.water-btn-visual {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    color: var(--text-color);
}

.water-btn-visual:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.app-card.disabled {
    opacity: 0.2 !important;
    /* Significantly reduced opacity */
    filter: grayscale(100%) blur(1px) !important;
    /* Added blur for "unavailable" feel */
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.02);
    /* Darker background */
    border-color: transparent;
}

.app-card.disabled:hover,
.app-card.disabled:active,
.app-card.disabled:focus {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.2 !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.water-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.water-amount {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.water-subtext {
    font-size: 0.8rem;
    color: #94a3b8;
}

.custom-water-container {
    margin-bottom: 2rem;
}

.custom-water-input-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 5px;
    transition: border-color 0.3s;
}

.custom-water-input-wrapper:focus-within {
    border-color: var(--accent-primary);
}

#customWaterInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    width: 100%;
}

.btn-add-custom {
    background: var(--accent-primary);
    border: none;
    width: 50px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add-custom:hover {
    background: #0ea5e9;
    transform: scale(1.05);
}

.btn-reset-water {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    color: var(--text-color);
    font-family: inherit;
}

/* Goal Reached State */
.goal-reached .progress-ring__circle {
    stroke: var(--accent-o);
    filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.5));
}

.goal-reached #currentWater {
    color: var(--accent-o);
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
}

/* Goal Exceeded State (Overachiever) */
.goal-exceeded .progress-ring__circle {
    /* Main circle stays green (inherited from goal-reached or default) */
    /* stroke: var(--accent-gold); Removed to allow layering */
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.6));
}

.goal-exceeded #currentWater {
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

/* Custom App Icons */
.icon-x {
    color: var(--accent-x);
    text-shadow: 0 0 10px rgba(244, 114, 182, 0.5);
    font-weight: 800;
    margin-right: 5px;
}

.icon-o {
    color: var(--accent-o);
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
    font-weight: 800;
}

/* Expense Tracker Styles */
.expense-container {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    text-align: center;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
}

.expense-container h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--accent-green), var(--accent-gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.balance-container {
    margin-bottom: 2rem;
}

.balance-container h4 {
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.balance-container h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

.inc-exp-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.inc-exp-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inc-exp-card h4 {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.money {
    font-size: 1.2rem;
    font-weight: 700;
}

.money.plus {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.money.minus {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.expense-container h3 {
    text-align: left;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.list {
    list-style-type: none;
    margin-bottom: 2rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.list li {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border-right: 5px solid transparent;
    transition: all 0.3s ease;
}

.list li:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.list li.plus {
    border-right-color: var(--accent-green);
}

.list li.minus {
    border-right-color: var(--accent-red);
}

.delete-btn {
    cursor: pointer;
    background-color: var(--accent-red);
    border: 0;
    color: #fff;
    font-size: 14px;
    line-height: 14px;
    padding: 2px 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-100%, -50%);
    border-radius: 4px;
}

.list li:hover .delete-btn {
    opacity: 1;
}

.form-control {
    margin-bottom: 1rem;
    text-align: left;
}

.form-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.form-control input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.form-control input:focus {
    border-color: var(--accent-primary);
}

.btn-add-transaction {
    background: linear-gradient(135deg, var(--accent-green), #27ae60);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    margin-top: 1rem;
}

.btn-add-transaction:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(46, 204, 113, 0.4);
}

/* Expense Navigation */
.expense-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover:not(.active) {
    color: white;
}

/* Updated List Item for Date */
.list li {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
}

.transaction-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.transaction-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

/* Category Chips */
.category-chips {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.category-chips::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.chip:hover {
    transform: translateY(-2px);
}

.chip.income {
    border-color: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.chip.income:hover,
.chip.income.active {
    background: rgba(46, 204, 113, 0.2);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.2);
}

.chip.expense {
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.chip.expense:hover,
.chip.expense.active {
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}

/* Connect Four */
.c4-board {
    display: grid;
    grid-template-columns: repeat(7, auto);
    gap: 10px;
    background-color: #1e3a8a;
    /* Dark Blue Board */
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.c4-cell {
    width: 50px;
    height: 50px;
    background-color: rgba(15, 23, 42, 0.6);
    /* Hole */
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: visible;
    box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.c4-piece {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: dropIn 0.5s cubic-bezier(0.5, 0, 0.5, 1) forwards;
    transform: translateY(var(--fall-distance));
}

@keyframes dropIn {
    from {
        transform: translateY(var(--fall-distance));
    }

    to {
        transform: translateY(0);
    }
}

.c4-piece.player1 {
    background-color: var(--accent-red);
    box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.2), 0 0 10px rgba(239, 68, 68, 0.5);
}

.c4-piece.player2 {
    background-color: var(--accent-gold);
    box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.2), 0 0 10px rgba(251, 191, 36, 0.5);
}

.text-red {
    color: var(--accent-red);
    font-weight: bold;
}

.text-yellow {
    color: var(--accent-gold);
    font-weight: bold;
}

@media (max-width: 500px) {
    .c4-cell {
        width: 35px;
        height: 35px;
    }

    .c4-board {
        gap: 5px;
        padding: 10px;
    }
}

/* Memory Match */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 15px;
    margin-bottom: 2rem;
    justify-content: center;
}

.memory-card {
    width: 80px;
    height: 80px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card .front,
.memory-card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.memory-card .front {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: bold;
}

.memory-card .back {
    background: white;
    color: #333;
    transform: rotateY(180deg);
}

.text-blue {
    color: #60a5fa;
    font-weight: bold;
}

.text-green {
    color: #4ade80;
    font-weight: bold;
}

@media (max-width: 400px) {
    .memory-card {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .memory-board {
        gap: 10px;
    }
}

/* Pong */
.pong-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#pongCanvas {
    background-color: #0f172a;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

@media (max-width: 650px) {
    #pongCanvas {
        width: 100%;
        height: auto;
    }
}

/* Rock Paper Scissors */
.rps-selection {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.rps-btn {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.rps-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.rps-showdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 2rem;
}

.rps-player-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rps-icon-large {
    font-size: 5rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vs {
    font-size: 2rem;
    font-weight: bold;
    color: #94a3b8;
}

.winner-text {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

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

    to {
        transform: scale(1);
    }
}

/* Snake */
.snake-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#snakeCanvas {
    background-color: #0f172a;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

/* Hangman */
.hangman-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 5px;
}

.hint-text {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.hangman-drawing-container {
    margin-bottom: 2rem;
}

.word-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.letter {
    border-bottom: 3px solid white;
    width: 30px;
    height: 40px;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.key-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.key-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.key-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

/* Coin Toss */
.coin-container {
    perspective: 1000px;
    margin: 3rem auto;
    width: 150px;
    height: 150px;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    /* transition handled in JS for dynamic rotation */
}

.coin .side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    border: 5px solid rgba(251, 191, 36, 0.8);
}

.coin .heads {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.coin .tails {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #1e293b;
    transform: rotateY(180deg);
}

/* Tug of War */
.tug-arena {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.tug-bar-container {
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.tug-bar {
    height: 100%;
    width: 50%;
    background: linear-gradient(to right, var(--accent-red), var(--accent-primary));
    transition: width 0.1s linear;
}

.tug-center-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    z-index: 2;
}

.tug-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.tug-btn {
    flex: 1;
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tug-btn:active {
    transform: scale(0.95);
}

.tug-btn.p1 {
    background: var(--accent-red);
}

.tug-btn.p2 {
    background: var(--accent-primary);
}

/* Math Duel */
.math-split-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

.math-player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.p2-area {
    transform: rotate(180deg);
    border-bottom: 2px solid var(--glass-border);
}

.math-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.math-question {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 2rem;
    font-family: monospace;
}

.math-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.math-option {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    border: none;
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}

.math-option:active {
    background: var(--accent-primary);
    transform: scale(0.95);
}

.math-divider {
    height: 0;
    position: relative;
    z-index: 10;
}

.math-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--accent-primary);
    width: 80%;
}

.math-home-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 20;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Reaction Duel */
.reaction-split-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

.reaction-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    transition: background 0.2s;
    cursor: pointer;
}

.reaction-area.idle {
    background: #334155;
}

.reaction-area.waiting {
    background: #ef4444;
    /* Red */
}

.reaction-area.go {
    background: #22c55e;
    /* Green */
}

.reaction-area.win {
    background: #22c55e;
}

.reaction-area.lose {
    background: #ef4444;
    opacity: 0.5;
}

.reaction-area.p2-area {
    transform: rotate(180deg);
    border-bottom: 2px solid white;
}

.reaction-score {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    pointer-events: none;
}

.reaction-msg {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    pointer-events: none;
}

.reaction-divider {
    height: 0;
    position: relative;
    z-index: 10;
}

.reaction-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid white;
    width: 80%;
    color: white;
}

.reaction-home-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 20;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid white;
}

/* Dots and Boxes */
.dots-grid {
    display: grid;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    width: fit-content;
}

.dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

.line {
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.line:hover {
    background: rgba(255, 255, 255, 0.3);
}

.line.taken {
    background: white;
    cursor: default;
}

.h-line {
    width: 100%;
    height: 10px;
}

.v-line {
    width: 10px;
    height: 100%;
}

.box {
    width: 100%;
    height: 100%;
    transition: background 0.3s;
}

.box.p1 {
    background: var(--accent-red);
    opacity: 0.6;
}

.box.p2 {
    background: var(--accent-primary);
    opacity: 0.6;
}

.p1-turn {
    color: var(--accent-red);
}

.p2-turn {
    color: var(--accent-primary);
}

/* Simon Duel */
.simon-split-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
    background: #1e293b;
}

.simon-player-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    transition: opacity 0.3s;
}

.simon-player-area.p2-area {
    transform: rotate(180deg);
    border-bottom: 2px solid white;
}

.simon-player-area.eliminated {
    opacity: 0.2;
    pointer-events: none;
}

.simon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 200px;
    height: 200px;
}

.simon-btn {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.1s, transform 0.1s;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.simon-btn:active,
.simon-btn.active {
    opacity: 1;
    transform: scale(0.95);
    box-shadow: 0 0 20px currentColor;
}

.simon-btn.green {
    background-color: #22c55e;
    color: #22c55e;
}

.simon-btn.red {
    background-color: #ef4444;
    color: #ef4444;
}

.simon-btn.yellow {
    background-color: #eab308;
    color: #eab308;
}

.simon-btn.blue {
    background-color: #3b82f6;
    color: #3b82f6;
}

.simon-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.simon-status {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    border: 1px solid white;
}

.simon-home-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 20;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid white;
}

/* Dice Duel */
.dice-split-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
    background: #0f172a;
}

.dice-player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.dice-player-area.p2-area {
    transform: rotate(180deg);
    border-bottom: 2px solid white;
    background: rgba(255, 255, 255, 0.05);
}

.dice-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.dice-display {
    font-size: 6rem;
    color: white;
    margin: 1rem 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.dice-btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.dice-btn:active {
    transform: scale(0.95);
}

.dice-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.dice-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.dice-status {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    border: 1px solid var(--accent-primary);
    font-size: 1.2rem;
}

.dice-home-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 20;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid white;
}

/* Time Tracker */
.tracker-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.tracker-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s, border-color 0.2s;
}

.tracker-card h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tracker-card.productive h2 {
    color: var(--accent-green);
}

.tracker-card.wasted h2 {
    color: var(--accent-red);
}

.time-display {
    font-size: 3rem;
    font-weight: bold;
    font-family: monospace;
    margin-bottom: 1.5rem;
}

.tracker-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tracker-card.productive .tracker-btn:hover {
    background: var(--accent-green);
    color: #0f172a;
}

.tracker-card.productive .tracker-btn.active {
    background: var(--accent-green);
    color: #0f172a;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

.tracker-card.wasted .tracker-btn:hover {
    background: var(--accent-red);
    color: white;
}

.tracker-card.wasted .tracker-btn.active {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@media (min-width: 600px) {
    .tracker-container {
        flex-direction: row;
        max-width: 800px;
    }

    .tracker-card {
        flex: 1;
    }
}

.date-display {
    font-size: 1rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* History View */
.history-content {
    max-width: 500px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 2rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: left;
}

.history-date {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.history-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat.prod .label {
    color: var(--accent-green);
    font-size: 0.8rem;
}

.stat.waste .label {
    color: var(--accent-red);
    font-size: 0.8rem;
}

.stat .value {
    font-family: monospace;
    font-size: 1.1rem;
}

.history-bar {
    height: 6px;
    background: var(--accent-red);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent-green);
}

.history-empty {
    color: #cbd5e1;
    font-style: italic;
}

/* Time Tracker Visualization */
.tracker-vis-container {
    width: 100%;
    max-width: 600px;
    margin: 1rem auto 2rem;
}

.tracker-bar {
    display: flex;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid var(--glass-border);
}

.bar-segment {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-segment.productive {
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.bar-segment.wasted {
    background: var(--accent-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.vis-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0 5px;
}

#labelProductive {
    color: var(--accent-green);
}

#labelWasted {
    color: var(--accent-red);
}

/* Chat App */
.chat-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    width: 100%;
}

.chat-header {
    flex-shrink: 0;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--glass-border);
}

.chat-placeholder {
    color: #94a3b8;
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.msg-bubble {
    padding: 0.8rem 1rem;
    border-radius: 16px;
    position: relative;
    word-wrap: break-word;
}

.chat-message.sent .msg-bubble {
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received .msg-bubble {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.msg-info {
    font-size: 0.7rem;
    margin-bottom: 4px;
    opacity: 0.8;
    display: flex;
    gap: 8px;
}

.chat-message.sent .msg-info {
    justify-content: flex-end;
}

.msg-user {
    font-weight: bold;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    padding: 1rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    outline: none;
}

#chatInput:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.btn-send:hover {
    transform: scale(1.1);
}

.btn-send:active {
    transform: scale(0.95);
}

/* Online Mode Styles */
.mode-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

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

.mode-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.online-controls {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.status-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}

/* Global Status Bar */
.global-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: blur(5px);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#onlineCountDisplay {
    color: #4ade80;
    /* Green for online */
    font-weight: 600;
}

#globalUsernameDisplay {
    cursor: pointer;
    transition: color 0.2s;
}

#globalUsernameDisplay:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.separator {
    opacity: 0.3;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-color);
}

.player-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.player-list li {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-list li:last-child {
    border-bottom: none;
}

.player-avatar {
    width: 30px;
    height: 30px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    font-size: 0.8rem;
}

/* --- Business Game --- */
.business-layout {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.business-board {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 90vh;
    /* Maximize size */
    aspect-ratio: 1/1;
    background: #e2e8f0;
    /* Softer background */
    padding: 8px;
    border: 8px solid #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    position: relative;
}

.business-cell {
    background: white;
    border: 1px solid #94a3b8;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 2px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s;
}

.business-cell.corner {
    background: #f1f5f9;
    font-weight: 800;
    font-size: 0.8rem;
    justify-content: center;
    color: #334155;
    z-index: 2;
}

/* Full Color Cells */
.business-cell.brown {
    background: #d7ccc8;
    border: 2px solid #8d6e63;
}

.business-cell.lightblue {
    background: #b3e5fc;
    border: 2px solid #29b6f6;
}

.business-cell.pink {
    background: #f8bbd0;
    border: 2px solid #ec407a;
}

.business-cell.orange {
    background: #ffe0b2;
    border: 2px solid #ffa726;
}

.business-cell.red {
    background: #ffcdd2;
    border: 2px solid #ef5350;
}

.business-cell.yellow {
    background: #fff9c4;
    border: 2px solid #fdd835;
}

.business-cell.green {
    background: #c8e6c9;
    border: 2px solid #66bb6a;
}

.business-cell.darkblue {
    background: #c5cae9;
    border: 2px solid #5c6bc0;
}

/* Ownership Indicators */
.business-cell.owned-p1 {
    box-shadow: inset 0 0 0 4px #ef4444;
}

.business-cell.owned-p2 {
    box-shadow: inset 0 0 0 4px #3b82f6;
}

.business-cell.owned-p3 {
    box-shadow: inset 0 0 0 4px #22c55e;
}

.business-cell.owned-p4 {
    box-shadow: inset 0 0 0 4px #f59e0b;
}

.cell-name {
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.1;
    color: #0f172a;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.cell-price {
    font-size: 0.6rem;
    margin-bottom: 2px;
    color: #64748b;
    font-weight: 600;
}

.cell-players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 30%;
    pointer-events: none;
    /* Let clicks pass to cell */
}

.player-token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    z-index: 10;
}

.player-token.p1 {
    background: #ef4444;
}

.player-token.p2 {
    background: #3b82f6;
}

.player-token.p3 {
    background: #22c55e;
}

.player-token.p4 {
    background: #f59e0b;
}

/* Center Controls */
.center-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.center-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 5px;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.center-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 20px;
    font-weight: 500;
}

.dice-area {
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.dice-display {
    font-size: 2rem;
    font-weight: 800;
    color: #334155;
}

.btn-roll {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-roll:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
}

.btn-roll:active {
    transform: translateY(0);
}

.center-players {
    width: 100%;
    max-width: 300px;
}

.center-players ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.center-players li {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #475569;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
}

.center-players li.active-turn {
    border: 2px solid #3b82f6;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
}

.business-sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dice-display {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

/* Room List Styles */
.room-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
}

.room-list h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 5px;
    border-radius: 5px;
}

.room-item span {
    color: var(--text-color);
}

.room-item button {
    padding: 5px 10px;
    background: var(--primary-color);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.room-item button:hover {
    background: var(--primary-hover);
}

/* Developer Footer */
.developer-footer {
    width: 100%;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.developer-footer strong {
    color: #fff;
    font-weight: 600;
}

.developer-footer a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.2s;
}

.developer-footer a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}
/* Business Buy Modal */
#businessBuyModal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    border: 2px solid #e2e8f0;
}

#businessBuyModal h2 {
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

#businessBuyModal p {
    color: #64748b;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

#businessBuyModal .modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Local Play Button */
.btn-local-play {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    width: 100%;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.btn-local-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

/* App Version */
.app-version {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
}
