@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1c1c1e;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #636366;
    --accent-blue: #0a84ff;
    --accent-green: #30d158;
    --accent-red: #ff453a;
    --accent-orange: #ff9f0a;
    --accent-purple: #bf5af2;
    --border-color: rgba(255,255,255,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar .avatar-placeholder {
    width: 20px;
    height: 20px;
    color: white;
}

.main {
    flex: 1;
    padding: 16px 20px;
    padding-bottom: 100px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.balance-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10,132,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.balance-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.balance-label .icon {
    width: 14px;
    height: 14px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.currency-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon .icon {
    width: 18px;
    height: 18px;
}

.stat-icon.wins {
    background: rgba(48, 209, 88, 0.15);
    color: var(--accent-green);
}

.stat-icon.respect {
    background: rgba(191, 90, 242, 0.15);
    color: var(--accent-purple);
}

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

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon {
    width: 16px;
    height: 16px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255,255,255,0.12);
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:active {
    transform: scale(0.98);
}

.crypto-card {
    padding: 20px;
}

.crypto-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.crypto-price-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f7931a, #ffab40);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crypto-icon .icon {
    width: 24px;
    height: 24px;
    color: white;
}

.crypto-price {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.crypto-change {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.crypto-change.up {
    background: rgba(48, 209, 88, 0.15);
    color: var(--accent-green);
}

.crypto-change.down {
    background: rgba(255, 69, 58, 0.15);
    color: var(--accent-red);
}

.crypto-chart {
    height: 200px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.crypto-chart canvas {
    width: 100%;
    height: 100%;
}

.crypto-wallet {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.crypto-wallet .icon {
    width: 14px;
    height: 14px;
}

.crypto-wallet-value {
    color: var(--text-tertiary);
}

.crypto-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.97);
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #0077ed;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background: #28c04d;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #e63c32;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #252528;
}

.bonus-card {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.bonus-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-orange), #ff6b35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bonus-icon .icon {
    width: 24px;
    height: 24px;
    color: white;
}

.bonus-info {
    flex: 1;
}

.bonus-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.bonus-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.bonus-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
}

.bank-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bank-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-blue), #5856d6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bank-icon .icon {
    width: 24px;
    height: 24px;
    color: white;
}

.bank-info {
    flex: 1;
}

.bank-status {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.bank-details {
    font-size: 13px;
    color: var(--text-secondary);
}

.bank-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.bank-btn:hover {
    background: #252528;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.work-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.work-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.work-card:active {
    transform: scale(0.97);
}

.work-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-icon .icon {
    width: 24px;
    height: 24px;
}

.work-icon.miner {
    background: rgba(255, 159, 10, 0.15);
    color: var(--accent-orange);
}

.work-icon.coder {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-blue);
}

.work-icon.math {
    background: rgba(191, 90, 242, 0.15);
    color: var(--accent-purple);
}

.work-name {
    font-size: 14px;
    font-weight: 600;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shop-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.shop-item:hover {
    border-color: var(--accent-blue);
}

.shop-item:active {
    transform: scale(0.97);
}

.shop-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.shop-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-green);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.game-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.game-card:active {
    transform: scale(0.97);
}

.game-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-icon .icon {
    width: 28px;
    height: 28px;
}

.game-icon.mines {
    background: linear-gradient(135deg, #ff453a, #ff6b6b);
    color: white;
}

.game-icon.zamok {
    background: linear-gradient(135deg, #5856d6, #af52de);
    color: white;
}

.game-icon.dice {
    background: linear-gradient(135deg, #30d158, #34c759);
    color: white;
}

.game-icon.duel {
    background: linear-gradient(135deg, #ff9f0a, #ffcc00);
    color: white;
}

.game-icon.tictactoe {
    background: linear-gradient(135deg, #5e5ce6, #bf5af2);
    color: white;
}

.game-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.game-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.mines-container,
.zamok-container,
.pvp-container,
.tictactoe-container {
    display: none;
}

.mines-container.active,
.zamok-container.active,
.pvp-container.active,
.tictactoe-container.active {
    display: block;
}

/* ======================================
   TIC-TAC-TOE STYLES
   ====================================== */

.ttt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ttt-title {
    font-size: 18px;
    font-weight: 700;
}

.ttt-lobby {
    margin-bottom: 16px;
}

.ttt-game {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.ttt-game.hidden {
    display: none;
}

.ttt-players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.ttt-player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ttt-player:last-child {
    flex-direction: row-reverse;
}

.ttt-player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.ttt-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttt-player-avatar svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.ttt-player.active .ttt-player-avatar {
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(10, 132, 255, 0.4);
}

.ttt-player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ttt-player:last-child .ttt-player-info {
    align-items: flex-end;
}

.ttt-player-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ttt-player-symbol {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ttt-player-symbol svg {
    width: 20px;
    height: 20px;
}

.ttt-player-symbol.x svg {
    color: var(--accent-blue);
}

.ttt-player-symbol.o svg {
    color: var(--accent-red);
}

.ttt-vs {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.ttt-turn {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.ttt-turn.your-turn {
    color: var(--accent-green);
    background: rgba(48, 209, 88, 0.1);
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    aspect-ratio: 1;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.ttt-cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ttt-cell:hover:not(.filled):not(.disabled) {
    border-color: var(--accent-blue);
    background: rgba(10, 132, 255, 0.1);
    transform: scale(1.02);
}

.ttt-cell:active:not(.filled):not(.disabled) {
    transform: scale(0.96);
}

.ttt-cell.filled {
    cursor: default;
}

.ttt-cell.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ttt-cell.winning {
    border-color: var(--accent-green) !important;
    background: rgba(48, 209, 88, 0.2) !important;
    animation: winPulse 0.6s ease infinite alternate;
}

@keyframes winPulse {
    from { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.4); }
    to { box-shadow: 0 0 20px 4px rgba(48, 209, 88, 0.3); }
}

.ttt-cell svg {
    width: 60%;
    height: 60%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ttt-cell.filled svg {
    opacity: 1;
    transform: scale(1);
}

.ttt-cell.x svg {
    color: var(--accent-blue);
    stroke-width: 4;
}

.ttt-cell.o svg {
    color: var(--accent-red);
    stroke-width: 4;
}

.ttt-result {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 700;
    margin-top: 12px;
}

.ttt-result.hidden {
    display: none;
}

.ttt-result.win {
    background: rgba(48, 209, 88, 0.15);
    color: var(--accent-green);
}

.ttt-result.lose {
    background: rgba(255, 69, 58, 0.15);
    color: var(--accent-red);
}

.ttt-result.draw {
    background: rgba(255, 159, 10, 0.15);
    color: var(--accent-orange);
}

/* ======================================
   PVP LOBBY STYLES
   ====================================== */

.pvp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pvp-title {
    font-size: 18px;
    font-weight: 700;
}

.pvp-create-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--accent-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.pvp-create-btn:hover {
    background: #0077ed;
    transform: scale(1.02);
}

.pvp-create-btn:active {
    transform: scale(0.98);
}

.pvp-create-btn .icon {
    width: 18px;
    height: 18px;
}

.pvp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pvp-game-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.pvp-game-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.pvp-game-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pvp-game-creator {
    font-size: 15px;
    font-weight: 600;
}

.pvp-game-bet {
    font-size: 13px;
    color: var(--accent-green);
    font-weight: 500;
}

.pvp-join-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: var(--accent-green);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.pvp-join-btn:hover {
    background: #28c04d;
}

.pvp-join-btn:active {
    transform: scale(0.97);
}

.pvp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.pvp-empty .icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin: 0 auto;
}

.mines-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.mines-stat {
    text-align: center;
}

.mines-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.mines-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.mines-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 20px;
}

.mines-cell:hover {
    background: #252528;
    border-color: var(--accent-blue);
}

.mines-cell.revealed {
    cursor: default;
}

.mines-cell.diamond {
    background: rgba(48, 209, 88, 0.15);
    border-color: var(--accent-green);
}

.mines-cell.bomb {
    background: rgba(255, 69, 58, 0.15);
    border-color: var(--accent-red);
}

.mines-cell .icon {
    width: 24px;
    height: 24px;
}

.zamok-scene {
    text-align: center;
    padding: 40px 20px;
}

.zamok-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zamok-image .icon {
    width: 80px;
    height: 80px;
    color: var(--accent-purple);
}

.zamok-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.zamok-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zamok-btn {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.zamok-btn:hover {
    background: #252528;
    border-color: var(--accent-blue);
}

.pvp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pvp-title {
    font-size: 18px;
    font-weight: 700;
}

.pvp-create-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pvp-create-btn .icon {
    width: 16px;
    height: 16px;
}

.pvp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pvp-game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.pvp-game-info {
    flex: 1;
}

.pvp-game-creator {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pvp-game-bet {
    font-size: 14px;
    color: var(--accent-green);
    font-weight: 600;
}

.pvp-join-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--accent-green);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.pvp-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.business-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Simplified business list item */
.biz-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.biz-list-item:hover {
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.biz-list-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.biz-list-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-blue);
}

.biz-list-info {
    flex: 1;
    min-width: 0;
}

.biz-list-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biz-list-customers {
    font-size: 12px;
    color: var(--text-secondary);
}

.biz-list-earnings {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-green);
    white-space: nowrap;
}

/* Business detail modal */
.biz-detail {
    padding: 8px 0;
}

.biz-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.biz-detail-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.biz-detail-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-blue);
}

.biz-detail-name {
    font-size: 20px;
    font-weight: 700;
}

.biz-detail-level {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Stats grid */
.biz-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.biz-stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.biz-stat-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.biz-stat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.biz-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Stock section */
.biz-stock-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.biz-stock-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.biz-stock-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.biz-stock-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.biz-stock-fill.green { background: var(--accent-green); }
.biz-stock-fill.yellow { background: var(--accent-orange); }
.biz-stock-fill.red { background: var(--accent-red); }

.biz-warning {
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent-orange);
}

/* Events section */
.biz-event-section {
    margin-bottom: 20px;
}

.biz-event-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.biz-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.biz-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.biz-event.positive {
    background: rgba(34, 197, 94, 0.1);
}

.biz-event.negative {
    background: rgba(239, 68, 68, 0.1);
}

.biz-event-icon {
    font-size: 14px;
}

.biz-event-text {
    flex: 1;
}

.biz-event-impact {
    font-weight: 600;
}

.biz-event.positive .biz-event-impact {
    color: var(--accent-green);
}

.biz-event.negative .biz-event-impact {
    color: var(--accent-red);
}

.biz-no-events {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px;
}

/* Action buttons grid */
.biz-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.biz-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
}

.biz-action-btn .biz-action-icon {
    font-size: 20px;
}

.biz-action-btn .biz-action-amount {
    font-size: 11px;
    opacity: 0.8;
}

.biz-action-btn.collect {
    background: var(--accent-green);
    color: white;
}

.biz-action-btn.refill {
    background: var(--accent-blue);
    color: white;
}

.biz-action-btn.upgrade {
    background: var(--accent-purple);
    color: white;
}

.biz-action-btn.promo {
    background: var(--accent-orange);
    color: white;
}

.biz-action-btn:hover {
    transform: scale(1.02);
}

/* SVG icons in business detail */
.biz-stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-blue);
}

.biz-action-svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.biz-action-svg svg {
    width: 22px;
    height: 22px;
}

.biz-event-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.biz-event-svg svg {
    width: 16px;
    height: 16px;
}

.biz-event.positive .biz-event-svg svg {
    stroke: var(--accent-green);
}

.biz-event.negative .biz-event-svg svg {
    stroke: var(--accent-red);
}

.biz-stock-icon {
    display: inline-flex;
    margin-right: 6px;
}

.biz-stock-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
}

.biz-warn-icon {
    display: inline-flex;
    margin-right: 4px;
}

.biz-warn-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent-orange);
}

.biz-event-title-icon {
    display: inline-flex;
    margin-right: 6px;
}

.biz-event-title-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
}

/* Sell button */
.biz-sell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.biz-sell-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

.biz-sell-icon {
    display: flex;
}

.biz-sell-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-red);
}

/* Danger button */
.btn-danger {
    background: var(--accent-red);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

/* Old business card styles (kept for compatibility) */
.business-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.business-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.business-name {
    font-size: 16px;
    font-weight: 700;
}

.business-income {
    font-size: 14px;
    color: var(--accent-green);
    font-weight: 600;
}

.business-stock {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-bottom: 6px;
    overflow: hidden;
}

.business-stock-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.business-stock-fill.green {
    background: var(--accent-green);
}

.business-stock-fill.yellow {
    background: var(--accent-orange);
}

.business-stock-fill.red {
    background: var(--accent-red);
}

.business-stock-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

.business-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.business-accumulated {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 16px;
}

.business-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.business-btn {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.business-btn.collect {
    background: var(--accent-green);
    color: white;
}

.business-btn.refill {
    background: var(--accent-blue);
    color: white;
}

.business-btn.upgrade {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.load-more-btn {
    width: 100%;
    margin-top: 16px;
}

.business-shop {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.business-shop-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.business-shop-card:hover {
    border-color: var(--accent-blue);
}

.business-shop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.business-shop-icon .icon {
    width: 24px;
    height: 24px;
}

.business-shop-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.business-shop-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-green);
}

.profile-header {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .icon {
    width: 40px;
    height: 40px;
    color: white;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-title {
    font-size: 14px;
    color: var(--accent-purple);
    font-weight: 500;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.inventory-name {
    font-size: 15px;
    font-weight: 500;
}

.inventory-amount {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.top-rank {
    width: 28px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.top-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.top-balance {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-green);
}

.admin-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.admin-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section-title .icon {
    width: 20px;
    height: 20px;
    color: var(--accent-blue);
}

.admin-input-group {
    margin-bottom: 12px;
}

.admin-input-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.admin-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
}

.admin-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.admin-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-blue);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.admin-btn:hover {
    background: #0077ed;
}

.admin-btn.danger {
    background: var(--accent-red);
}

.nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.nav-items {
    display: flex;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-tertiary);
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent-blue);
}

.nav-item .icon {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal {
    transform: translateY(100%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-primary);
}

.modal-close .icon {
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    background: #252528;
}

.modal-body {
    padding: 20px;
}

.modal-input {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    margin-bottom: 16px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.modal-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.modal-btn.green {
    background: var(--accent-green);
    color: white;
}

.modal-btn.red {
    background: var(--accent-red);
    color: white;
}

.modal-percent-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.percent-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.percent-btn:hover {
    border-color: var(--accent-blue);
}

.percent-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.dice-animation {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    perspective: 600px;
}

.dice-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: diceRoll 1.5s ease-out;
}

@keyframes diceRoll {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    25% { transform: rotateX(360deg) rotateY(180deg); }
    50% { transform: rotateX(720deg) rotateY(360deg); }
    75% { transform: rotateX(1080deg) rotateY(540deg); }
    100% { transform: rotateX(1440deg) rotateY(720deg); }
}

.duel-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 24px 0;
}

.duel-player {
    text-align: center;
}

.duel-player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: playerPulse 0.5s ease infinite alternate;
}

@keyframes playerPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.duel-vs {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-red);
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    z-index: 300;
    opacity: 1;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.toast.success {
    background: var(--accent-green);
    color: white;
}

.toast.error {
    background: var(--accent-red);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-tertiary);
}

.work-challenge {
    text-align: center;
}

.work-timer {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-orange);
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

.work-instruction {
    font-size: 16px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.work-grid-challenge {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.work-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-cell:hover {
    border-color: var(--accent-blue);
    background: #252528;
}

.work-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.work-option {
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.work-option:hover {
    border-color: var(--accent-blue);
    background: #252528;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Autocomplete styles */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
    box-shadow: var(--shadow);
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--bg-card);
}

.autocomplete-name {
    font-size: 14px;
    font-weight: 600;
}

.autocomplete-username {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Additional work icons */
.work-icon.lumberjack {
    background: rgba(139, 90, 43, 0.15);
    font-size: 22px;
}

.work-icon.farmer {
    background: rgba(48, 209, 88, 0.15);
    font-size: 22px;
}

.work-icon.fisher {
    background: rgba(10, 132, 255, 0.15);
    font-size: 22px;
}

.work-icon.driver {
    background: rgba(255, 69, 58, 0.15);
    font-size: 22px;
}

.work-icon.cook {
    background: rgba(255, 159, 10, 0.15);
    font-size: 22px;
}

/* Update work grid to fit 4 columns for 8 jobs */
.work-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.work-card {
    padding: 14px 8px;
}

.work-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-icon .icon {
    width: 20px;
    height: 20px;
}

.work-name {
    font-size: 10px;
    text-align: center;
}

/* Youth job colors */
.work-icon.vibecoder {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.work-icon.delivery {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
}

.work-icon.freelancer {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
}

.work-icon.blogger {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
}

.work-icon.reseller {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: white;
}

.work-icon.smm {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

.work-icon.tutor {
    background: linear-gradient(135deg, #14b8a6, #2dd4bf);
    color: white;
}

.work-icon.samokat {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

/* Dynamic Modal */
.dynamic-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dynamic-modal.active {
    opacity: 1;
    visibility: visible;
}

.dynamic-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.dynamic-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.dynamic-modal.active .dynamic-modal-content {
    transform: translateY(0);
}

.dynamic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.dynamic-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.dynamic-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dynamic-modal-body {
    padding: 20px;
}

/* Shop confirmation button styles */
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-success {
    background: var(--accent-green);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

/* Z-Bank Card */
.zbank-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.zbank-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.zbank-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.zbank-logo .icon {
    width: 28px;
    height: 28px;
    stroke: white;
}

.zbank-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.zbank-action .icon {
    width: 16px;
    height: 16px;
    stroke: rgba(255,255,255,0.8);
}

/* Transaction Item */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.transaction-item:hover {
    border-color: var(--accent-blue);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon svg {
    width: 20px;
    height: 20px;
}

.transaction-icon.income {
    background: rgba(34, 197, 94, 0.15);
}

.transaction-icon.income svg {
    stroke: var(--accent-green);
}

.transaction-icon.expense {
    background: rgba(239, 68, 68, 0.15);
}

.transaction-icon.expense svg {
    stroke: var(--accent-red);
}

.transaction-info {
    flex: 1;
}

.transaction-title {
    font-weight: 600;
    font-size: 14px;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-weight: 700;
    font-size: 15px;
}

.transaction-amount.income {
    color: var(--accent-green);
}

.transaction-amount.expense {
    color: var(--accent-red);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.shop-item.disabled {
    opacity: 0.6;
    pointer-events: none;
    border-color: var(--text-tertiary);
}

/* CASINO IMPROVED */
.casino-container {
    padding: 20px;
    text-align: center;
}

.casino-machine {
    background: #222;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    border: 4px solid #ffd700;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.casino-window {
    width: 60px;
    height: 80px;
    background: #fff;
    border: 2px solid #555;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.casino-strip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.casino-strip.spinning {
    /* Create blur effect via animation */
    animation: spinBlur 0.1s infinite linear;
    filter: blur(4px);
}

.casino-strip.bounce {
    animation: bounceResult 0.3s ease-out;
}

.casino-symbol {
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.casino-symbol svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.casino-arm-base {
    width: 16px;
    height: 60px;
    background: #444;
    border-radius: 4px;
    margin-top: 10px;
    position: relative;
}

.casino-arm-stick {
    width: 12px;
    height: 100px;
    background: linear-gradient(to bottom, #d44, #900);
    border-radius: 6px;
    position: absolute;
    bottom: 50%;
    left: 2px;
    transform-origin: bottom center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.casino-arm-stick.pulled {
    transform: rotate(180deg);
}

.casino-knob {
    width: 30px;
    height: 30px;
    background: #f00;
    border-radius: 50%;
    position: absolute;
    top: -15px;
    left: -9px;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.5);
}

.casino-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 240px;
    margin: 0 auto;
}

.casino-bet-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: 8px;
}

.casino-bet-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 700;
    width: 80px;
    text-align: center;
}

@keyframes spinBlur {
    0% { transform: translateY(-48%); }
    100% { transform: translateY(-52%); }
}

@keyframes bounceResult {
    0% { transform: translateY(-40%); }
    50% { transform: translateY(-55%); }
    100% { transform: translateY(-50%); }
}

/* WORK ITEMS UPDATE */
.work-grid-challenge .work-cell svg {
    width: 32px;
    height: 32px;
}

.work-option svg {
    width: 24px; /* Smaller inline svgs */
    height: 24px;
    vertical-align: middle;
}


/* DICE PVP */
.dice-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin: 20px 0;
}

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

.dice-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-card);
    overflow: hidden;
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.dice-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dice-vs {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-tertiary);
    font-style: italic;
}

.dice-cube {
    font-size: 48px;
    transition: transform 0.5s;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-cube.rolling {
    animation: rollDice 0.5s infinite linear;
}

@keyframes rollDice {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.zbank-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.zbank-tab {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.zbank-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.zbank-tab-content {
    animation: fadeIn 0.2s ease;
}

.transfer-form {
    padding: 16px 0;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.user-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.user-search-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.user-search-item:hover {
    background: var(--bg-tertiary);
}

.user-search-name {
    font-weight: 600;
}

.user-search-username {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-search-empty {
    padding: 12px 16px;
    color: var(--text-tertiary);
    text-align: center;
}

.duel-arena {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0;
}

.duel-player {
    flex: 1;
    text-align: center;
}

.duel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card);
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid var(--accent-blue);
}

.duel-player.left .duel-avatar {
    border-color: var(--accent-blue);
}

.duel-player.right .duel-avatar {
    border-color: var(--accent-green);
}

.duel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duel-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duel-hp-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 4px;
}

.duel-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-green));
    border-radius: 5px;
    transition: width 0.2s ease;
}

.duel-score {
    font-size: 12px;
    color: var(--text-secondary);
}

.duel-vs {
    font-size: 32px;
    font-weight: 900;
}

.duel-log {
    max-height: 120px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 16px;
}


/* iOS-style Floating Tab Bar */
.nav {
    position: fixed;
    bottom: 24px !important;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 240px;
    max-width: 90%;
    background: rgba(28, 28, 30, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 32px;
    padding: 6px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.nav-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

/* Hide Header globally */
.header {
    display: none !important;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 24px;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item .icon {
    width: 28px;
    height: 28px;
    stroke-width: 2.2px;
}

/* Add padding to main content properly so it doesn't get hidden behind floating nav */
.main {
    padding-bottom: 100px !important;
    overflow: hidden !important; /* For sliding tabs */
    position: relative;
}

/* Sliding Tabs Logic */
.tabs-track {
    display: flex;
    width: 100%;
    gap: 40px; /* Gap between pages to prevent overlap visibility */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.tab-content {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: block !important;
    opacity: 1 !important;
}

/* Override existing display:none logic just in case */
.tab-content.active {
    display: block !important;
}

/* Responsive Nav Bar */
.nav {
    min-width: 240px !important;
    max-width: calc(100% - 32px) !important;
    padding: 6px !important;
    bottom: 16px !important;
    border-radius: 36px !important;
    transform-origin: center bottom;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav.nav-hidden {
    transform: scale(0) translateY(50px);
    opacity: 0;
    pointer-events: none;
}

.nav-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    position: relative;
    height: 48px;
}

.nav-highlight {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    z-index: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    pointer-events: none;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    min-width: 44px;
    border-radius: 24px;
    color: var(--text-secondary);
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 1;
    background: transparent !important;
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-item.active {
    color: var(--text-primary);
    background: transparent !important; /* Ensure transparent */
}

/* ======================================
   LOADER SPINNER
   ====================================== */

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
