/* --- GLOBAL & SETUP --- */
:root {
    --bg-deep: #0f172a;
    --bg-mid: #14213d;
    --panel: #fdfdfd;
    --panel-soft: #f4f7ff;
    --ink: #14213d;
    --ink-soft: #4b587c;
    --brand: #ff7a18;
    --brand-2: #ff3d68;
    --accent: #16b8a7;
    --danger-color: #dc3545;
    --success-color: #16a34a;
    --gem-color: #4f46e5;
    --line: rgba(20, 33, 61, 0.12);
    --shadow-lg: 0 24px 60px rgba(7, 20, 44, 0.35);
    --shadow-md: 0 12px 30px rgba(7, 20, 44, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--ink);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 122, 24, 0.3) 0%, transparent 42%),
        radial-gradient(circle at 85% 20%, rgba(79, 70, 229, 0.26) 0%, transparent 46%),
        radial-gradient(circle at 50% 85%, rgba(22, 184, 167, 0.22) 0%, transparent 35%),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(24px);
}

body::before {
    width: 260px;
    height: 260px;
    top: -80px;
    right: -80px;
    background: rgba(255, 122, 24, 0.4);
    animation: driftGlow 10s ease-in-out infinite alternate;
}

body::after {
    width: 300px;
    height: 300px;
    left: -90px;
    bottom: -90px;
    background: rgba(79, 70, 229, 0.35);
    animation: driftGlow 14s ease-in-out infinite alternate-reverse;
}

@keyframes driftGlow {
    from { transform: translateY(0) translateX(0) scale(1); }
    to { transform: translateY(16px) translateX(12px) scale(1.08); }
}

.hidden { display: none !important; }

.message {
    margin-top: 12px;
    font-weight: 700;
    text-align: center;
}

.message.success { color: var(--success-color); }
.message.error { color: var(--danger-color); }

button,
input,
select {
    font: inherit;
}

button {
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0) scale(0.98);
}

/* --- VIEW CONTAINER --- */
#app-container {
    width: 100%;
    height: 100%;
}

.view {
    width: 100%;
    height: 100%;
    display: none;
}

.view.active-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: viewFadeIn 0.6s ease;
}

.view-enter {
    animation: viewSlideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes viewFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes viewSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- AUTH VIEW --- */
.auth-box {
    width: min(92vw, 430px);
    padding: 34px;
    background: rgba(253, 253, 253, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
    animation: authPop 0.65s cubic-bezier(0.16, 0.84, 0.2, 1);
}

@keyframes authPop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 18px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink);
}

.auth-form input {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(255, 61, 104, 0.65);
    box-shadow: 0 0 0 4px rgba(255, 61, 104, 0.12);
}

.auth-form button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 10px 22px rgba(255, 61, 104, 0.3);
    cursor: pointer;
}

.auth-form button:hover {
    filter: brightness(1.04);
}

.form-switcher {
    text-align: center;
    margin-top: 14px;
    color: var(--ink-soft);
}

.form-switcher a {
    color: var(--brand-2);
    text-decoration: none;
    font-weight: 700;
}

/* --- GAME VIEW --- */
#game-view {
    width: min(96vw, 1200px);
    height: min(95vh, 880px);
    margin: auto;
    border-radius: 24px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: var(--shadow-lg);
}

header {
    padding: 14px 22px;
    background: linear-gradient(135deg, #1f2c56 0%, #152140 60%, #101a33 100%);
    color: #f8faff;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
}

header h1 {
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
}

#stats,
#account-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

#stats {
    justify-content: center;
}

#stats p,
#account-info p {
    margin: 0;
    font-size: clamp(0.9rem, 1.6vw, 1.06rem);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#logout-button {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
}

#equipped-pets-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(180deg, #f8fbff, #eef3ff);
    border-bottom: 1px solid var(--line);
}

.event-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff8db, #ffe58f);
    border-bottom: 1px solid rgba(120, 90, 0, 0.25);
}

.event-banner p {
    margin: 0;
    font-weight: 700;
    color: #7a5800;
}

#equipped-pets-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.equipped-pet-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid rgba(20, 33, 61, 0.25);
    border-radius: 50%;
    object-fit: contain;
    padding: 2px;
    box-shadow: 0 6px 14px rgba(31, 44, 86, 0.2);
}

#passive-income-display {
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
}

#game-main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 122, 24, 0.08), rgba(79, 70, 229, 0.1)),
        repeating-linear-gradient(45deg, rgba(20, 33, 61, 0.02) 0px, rgba(20, 33, 61, 0.02) 10px, rgba(255, 255, 255, 0.02) 10px, rgba(255, 255, 255, 0.02) 20px),
        #f7faff;
}

#game-main::before,
#game-main::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

#game-main::before {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(255, 122, 24, 0.2), transparent 65%);
    top: -220px;
    right: -130px;
}

#game-main::after {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2), transparent 62%);
    bottom: -180px;
    left: -100px;
}

#clicker-zone {
    position: relative;
    z-index: 2;
}

#clicker-image {
    width: min(42vw, 330px);
    height: min(42vw, 330px);
    object-fit: contain;
    cursor: pointer;
    filter: drop-shadow(0 18px 30px rgba(13, 22, 43, 0.35));
    animation: floatPet 4.6s ease-in-out infinite;
    transition: transform 0.12s ease, filter 0.2s ease;
}

#clicker-image:hover {
    filter: drop-shadow(0 24px 36px rgba(13, 22, 43, 0.43));
}

#clicker-image:active {
    transform: scale(0.92);
}

@keyframes floatPet {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

footer {
    padding: 12px;
    background: #f8fbff;
    border-top: 1px solid var(--line);
}

nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.nav-btn {
    padding: 11px 10px;
    font-size: 0.96rem;
    border: 1px solid rgba(20, 33, 61, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff, #f3f7ff);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(20, 33, 61, 0.1);
}

.nav-btn:hover {
    box-shadow: 0 10px 20px rgba(20, 33, 61, 0.16);
}

#admin-panel-button {
    background: linear-gradient(135deg, #ffdfdf, #ffc4c4);
    color: #7b1d1d;
    border-color: rgba(150, 30, 30, 0.3);
}

/* --- CLICK FEEDBACK --- */
.plus-one {
    position: absolute;
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
    font-weight: 800;
    opacity: 1;
    animation: floatUp 0.95s ease-out forwards;
    pointer-events: none;
}

.plus-one.coin {
    color: #f59e0b;
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.55);
}

.plus-one.gem {
    color: var(--gem-color);
    text-shadow: 0 2px 10px rgba(79, 70, 229, 0.5);
}

.click-ripple {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 122, 24, 0.65);
    animation: rippleOut 0.55s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleOut {
    to {
        transform: scale(7.5);
        opacity: 0;
    }
}

@keyframes floatUp {
    to {
        transform: translateY(-120px);
        opacity: 0;
    }
}

/* --- MODAL STYLES --- */
#modal-backdrop,
#custom-alert-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 16, 34, 0.68);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal-content {
    background: var(--panel);
    padding: 26px;
    border-radius: 18px;
    width: min(94vw, 980px);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.28s ease;
}

#custom-alert-box {
    background: var(--panel);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    min-width: min(92vw, 340px);
    box-shadow: var(--shadow-md);
}

#custom-alert-message {
    margin-bottom: 16px;
    font-size: 1.05rem;
    color: var(--ink);
}

#custom-alert-buttons button {
    padding: 10px 18px;
    margin: 0 6px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

#custom-alert-buttons .ok-btn {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

#custom-alert-buttons .cancel-btn {
    background: #dde3ef;
    color: #213056;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#modal-close-button {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #9da7bf;
}

#modal-body h2,
#modal-body h3 {
    text-align: center;
    margin: 14px 0 10px;
    color: var(--ink);
    font-family: 'Chakra Petch', sans-serif;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.grid-container-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.shop-item,
.inventory-item,
.upgrade-item,
.market-item {
    border: 1px solid rgba(20, 33, 61, 0.12);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    background: linear-gradient(145deg, #fff, #f7f9ff);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: 0 6px 14px rgba(13, 26, 48, 0.09);
}

.shop-item:hover,
.inventory-item:hover,
.upgrade-item:hover,
.market-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 26px rgba(13, 26, 48, 0.15);
}

.inventory-item.hatchable,
.inventory-item.equipable,
.inventory-item.unequipable {
    cursor: pointer;
}

.item-image {
    width: 84px;
    height: 84px;
    object-fit: contain;
    margin-bottom: 8px;
}

.item-name {
    font-weight: 800;
    color: var(--ink);
}

.rarity-common { color: #8b95a7; }
.rarity-uncommon { color: #1f9d55; }
.rarity-rare { color: #1d4ed8; }
.rarity-ultra-rare { color: #8b5cf6; }
.rarity-legendary { color: #f59e0b; }
.rarity-ultra-legendary {
    color: #f97316;
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.35);
}
.rarity-secret {
    color: #050505;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}
.rarity-glitch {
    color: #00ff7f;
    position: relative;
    display: inline-block;
    text-shadow: -1px 0 #09f, 1px 0 #f0f;
    animation: glitchFlicker 0.8s infinite steps(2);
}

@keyframes glitchFlicker {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

.item-cost {
    font-weight: 800;
}

.item-cost.coin { color: #d97706; }
.item-cost.gem { color: var(--gem-color); }

.buy-button,
.action-button {
    margin-top: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.buy-button:disabled,
.action-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.upgrade-item.purchased {
    background: linear-gradient(145deg, #ddf7e7, #c8f1dd);
    border-color: rgba(22, 163, 74, 0.45);
}

/* --- TOOLTIP --- */
.tooltip {
    visibility: hidden;
    width: 188px;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 8px;
    position: absolute;
    z-index: 1001;
    bottom: 110%;
    left: 50%;
    margin-left: -94px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    font-size: 0.86rem;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.inventory-item:hover .tooltip,
.shop-item:hover .tooltip,
.upgrade-item:hover .tooltip,
.market-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* --- ADMIN PANEL --- */
.admin-section {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.admin-section h3 {
    margin-bottom: 10px;
}

.admin-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-section input,
.admin-section label,
.admin-section select {
    padding: 8px;
    border: 1px solid #cad4ea;
    border-radius: 8px;
}

#egg-pet-selector {
    border: 1px solid #cad4ea;
    padding: 10px;
    border-radius: 8px;
}

#egg-pet-selector div {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

#egg-pet-selector input[type="number"] {
    width: 80px;
}

.deletable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #e7ebf5;
}

.delete-btn {
    background: var(--danger-color);
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- EGG HATCHING VIEW --- */
.hatching-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 122, 24, 0.32), transparent 42%),
        radial-gradient(circle at 75% 72%, rgba(79, 70, 229, 0.28), transparent 46%),
        rgba(5, 10, 20, 0.9);
    z-index: 2000;
    color: #fff;
    text-align: center;
}

#hatching-title {
    font-size: clamp(2rem, 5vw, 4.2rem);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    animation: pulse 1.9s infinite;
}

@keyframes pulse {
    0%, 100% { text-shadow: 0 0 10px #fff, 0 0 26px rgba(255, 122, 24, 0.8); }
    50% { text-shadow: 0 0 18px #fff, 0 0 36px rgba(79, 70, 229, 0.85); }
}

#hatching-egg-image {
    max-width: 420px;
    width: min(86vw, 420px);
    cursor: pointer;
    transition: transform 0.1s;
}

#hatching-egg-image.shake {
    animation: shakeHard 0.1s 2;
}

@keyframes shakeHard {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-15px) rotate(-5deg); }
    75% { transform: translateX(15px) rotate(5deg); }
}

.hatched-pet-reveal {
    text-align: center;
    animation: reveal 0.55s ease-out;
}

#hatching-egg-image.hatch-final {
    animation: hatchBoom 0.7s ease forwards;
}

@keyframes hatchBoom {
    0% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
    45% { transform: scale(1.2) rotate(8deg); opacity: 1; filter: brightness(1.6); }
    100% { transform: scale(0.7) rotate(-12deg); opacity: 0; filter: brightness(2); }
}

.hatch-flash {
    position: fixed;
    inset: 0;
    z-index: 2050;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
    animation: hatchFlash 0.45s ease-out forwards;
}

@keyframes hatchFlash {
    from { opacity: 0; }
    45% { opacity: 1; }
    to { opacity: 0; }
}

@keyframes reveal {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- EVENT STYLES --- */
.event-button {
    position: absolute;
    right: 18px;
    transform: translateY(-50%);
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #16b8a7, #2dd4bf);
    color: #083a35;
    border: 2px solid #0f766e;
    border-radius: 12px;
    cursor: pointer;
    animation: pulse 1.8s infinite;
}

#tictactoe-event-button { top: 50%; }
#rps-event-button { top: 65%; }

.event-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.luck-event-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}

#luck-event-stage,
#luck-event-tries {
    font-weight: 700;
}

#luck-current-reward,
#luck-next-reward {
    width: min(100%, 300px);
}

#luck-event-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-inline-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#event-game-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 6px;
    background: #12213f;
    border: 6px solid #12213f;
    border-radius: 10px;
}

.event-cell {
    background: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4em;
    font-weight: 700;
}

.event-cell.playable:hover {
    background: #eef2ff;
    cursor: pointer;
}

#event-info {
    flex-grow: 1;
    text-align: center;
}

#event-controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* --- TRADING STYLES --- */
.online-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e8edf8;
}

.trade-main-container {
    display: flex;
    gap: 10px;
}

.trade-side {
    flex: 1;
    border: 1px solid #ccd6ed;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    background: #fbfdff;
}

.trade-side h3 {
    text-align: center;
    margin-bottom: 10px;
}

.trade-offer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    min-height: 160px;
    background: #f0f4ff;
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.trade-currency-offer,
.trade-currency-display {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.trade-value-display {
    text-align: center;
    font-weight: 700;
    color: #4338ca;
    margin-bottom: 8px;
}

.trade-currency-offer input {
    width: 90px;
}

.trade-inventory-selector {
    margin-top: 10px;
    border-top: 1px solid #ccd6ed;
    padding-top: 10px;
    flex-grow: 1;
}

.trade-inventory-selector h4 {
    text-align: center;
    margin-bottom: 6px;
}

.trade-inventory-selector .grid-container {
    max-height: 200px;
    overflow-y: auto;
}

.trade-inventory-selector .inventory-item {
    cursor: pointer;
}

.trade-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ccd6ed;
}

.trade-ready-status {
    text-align: center;
}

.trade-ready-status span.ready {
    color: var(--success-color);
    font-weight: 800;
}

.trade-ready-status span.not-ready {
    color: var(--danger-color);
    font-weight: 800;
}

#trade-cancel-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

#trade-accept-btn.ready {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* --- MOBILE TUNING --- */
@media (max-width: 1024px) {
    #game-view {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #stats,
    #account-info {
        justify-content: center;
        flex-wrap: wrap;
    }

    nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .event-container,
    .trade-main-container {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .auth-box {
        padding: 24px;
        border-radius: 18px;
    }

    .grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-container-large {
        grid-template-columns: 1fr;
    }

    nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #event-game-board {
        grid-template-columns: repeat(3, 76px);
        grid-template-rows: repeat(3, 76px);
    }

    .event-cell {
        font-size: 2.4rem;
    }
}
