
:root {
    --bg-base: #09090b;
    --bg-frame: #0f0f0f;
    --bg-card: #171717;
    --bg-card-hover: #1f1f1f;
    --bg-input: #09090b;
    --bg-nav: #111111;

    --border: #262626;
    --border-focus: #fafafa;

    --accent: #fafafa;
    --accent-dim: #d4d4d4;
    --accent-bg: rgba(250, 250, 250, 0.08);

    --gold: #c9a96e;
    --gold-dim: #a68b55;
    --gold-bg: rgba(201, 169, 110, 0.12);

    --green: #22c55e;
    --red: #ef4444;
    --blue: #3b82f6;

    --text-1: #fafafa;
    --text-2: #a3a3a3;
    --text-3: #525252;

    --felt: #0a1a10;
    --felt-border: #14532d;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

@font-face {
    font-family: 'Noto Kufi Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/NotoKufiArabic-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Noto Kufi Arabic';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/NotoKufiArabic-Medium.ttf') format('truetype');
}
@font-face {
    font-family: 'Noto Kufi Arabic';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/NotoKufiArabic-SemiBold.ttf') format('truetype');
}
@font-face {
    font-family: 'Noto Kufi Arabic';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/NotoKufiArabic-Bold.ttf') format('truetype');
}

*, *::before, *::after {
    box-sizing: border-box;
    font-family: 'Noto Kufi Arabic', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.08);
}

.border-theme, [class*="border-theme"] {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
.border-theme\/50, .border-theme\/40, .border-theme\/30, .border-theme\/20, .border-theme\/10 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

html {
    font-size: 14px;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-base);
    color: var(--text-1);
    direction: rtl;
    touch-action: manipulation;
    overflow: hidden;
    height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

svg[data-lucide], .lucide {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

#app-container {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    max-height: 100dvh;
    background-color: var(--bg-frame);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    margin: 0 auto;
}

@media (min-width: 640px) and (min-height: 720px) and (hover: hover) {
    #app-container {
        border-radius: 20px;
        height: min(94dvh, 900px);
        max-height: 900px;
        border: 1px solid var(--border);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
        margin: auto;
    }
}

#main-app-header {
    background-color: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.45rem;
    padding-left: clamp(0.4rem, 2vw, 0.75rem);
    padding-right: clamp(0.4rem, 2vw, 0.75rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 30;
    flex-shrink: 0;
    gap: 0.35rem;
    min-height: 48px;
    box-sizing: border-box;
}

#btn-top-connection-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
}
#btn-top-connection-status:hover { background: var(--bg-card-hover); }

.currency-pill-gold,
.currency-pill-cyan {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem clamp(0.35rem, 1.5vw, 0.5rem);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    font-size: clamp(0.6rem, 2vw, 0.72rem);
}
.currency-pill-gold:hover,
.currency-pill-cyan:hover {
    background: var(--bg-card-hover);
}

main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 64px;                           
}

#app-container.in-waiting-room #main-app-header,
#app-container.in-game #main-app-header {
    display: none !important;
}

#app-container.in-waiting-room #bottom-nav,
#app-container.in-game #bottom-nav {
    display: none !important;
}

#app-container.in-waiting-room main,
#app-container.in-game main {
    padding-bottom: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

#game-lobby-view {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100%;
    overflow-y: auto;
}

.lobby-welcome-banner {
    background: linear-gradient(135deg, #18181b 0%, #121214 100%);
    border: 1px solid rgba(201, 169, 110, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.game-hero-banner {
    background: linear-gradient(135deg, #1a1a1d 0%, #161618 100%);
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: var(--radius-xl);
    padding: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.game-hero-banner:hover {
    background: linear-gradient(135deg, #222226 0%, #1a1a1d 100%);
    border-color: rgba(201, 169, 110, 0.6);
    box-shadow: 0 6px 18px rgba(201, 169, 110, 0.12);
}
.game-hero-banner:active { transform: scale(0.985); }

.hero-play-cta {
    background-color: var(--gold);
    color: #09090b;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
    transition: background-color 0.15s, transform 0.15s;
}
.game-hero-banner:hover .hero-play-cta {
    background-color: #dfbe7d;
    transform: translateX(-2px);
}

.game-mode-tile {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(0.5rem, 1.5vh, 0.8rem) clamp(0.25rem, 1vw, 0.4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 0;
}
.game-mode-tile:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}
.game-mode-tile:active { transform: scale(0.97); }

.mode-tile-icon-pod {
    width: clamp(2rem, 5.5vw, 2.35rem);
    height: clamp(2rem, 5.5vw, 2.35rem);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(0.25rem, 0.8vh, 0.45rem);
    transition: transform 0.15s ease;
}
.game-mode-tile:hover .mode-tile-icon-pod {
    transform: scale(1.08);
}

.quick-action-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(0.45rem, 1.2vh, 0.65rem) clamp(0.25rem, 1vw, 0.4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.2rem, 0.8vw, 0.4rem);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 0;
    overflow: hidden;
}
.quick-action-pill:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(201, 169, 110, 0.35);
    transform: translateY(-1px);
}
.quick-action-pill:active { transform: scale(0.97); }

.rules-compact-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.server-opt-btn {
    transition: all 0.15s ease;
}
.server-opt-btn.active {
    border-color: rgba(201, 169, 110, 0.6);
    background-color: var(--gold-bg);
}

.ping-badge-fast {
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    background-color: rgba(52, 211, 153, 0.1) !important;
}
.ping-badge-medium {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    background-color: rgba(251, 191, 36, 0.1) !important;
}
.ping-badge-slow {
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    background-color: rgba(248, 113, 113, 0.1) !important;
}

#lobby-open-rooms-list {
    max-height: 14rem;
    overflow-y: auto;
}

#online-waiting-view {
    background: radial-gradient(circle at 50% 28%, #0e5c68 0%, #09434d 55%, #05262c 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.waiting-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 2.2vh, 1.15rem);
    width: 100%;
    padding: clamp(0.4rem, 1.6vh, 0.9rem) 0 clamp(0.25rem, 1vh, 0.5rem);
    overflow-y: auto;
    box-sizing: border-box;
}

#waiting-players-grid {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 0.25rem 0.5rem;
    box-sizing: border-box;
}

.waiting-progress-container {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 9999px;
    overflow: hidden;
}
.waiting-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 9999px;
}

.waiting-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.45rem 0.6rem;
}
.waiting-control-bar .voice-btn-mini {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.waiting-control-bar .voice-btn-mini svg {
    width: 1.05rem;
    height: 1.05rem;
}
.waiting-count-pill {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.24rem 0.6rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.waiting-leave-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.waiting-leave-btn:hover {
    color: #ffffff;
    background: #ef4444;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transform: scale(1.02);
}
.waiting-leave-btn:active {
    transform: scale(0.96);
    background: #dc2626;
}
.waiting-leave-btn svg,
.waiting-leave-btn i {
    color: #f87171;
    stroke: currentColor;
    transition: color 0.15s ease;
}
.waiting-leave-btn:hover svg,
.waiting-leave-btn:hover i {
    color: #ffffff;
    stroke: #ffffff;
}

.waiting-arena-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: auto 0;
    height: 100%;
    justify-content: center;
}
.room-team {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.5rem 0.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.room-team-1v1 {
    background: transparent;
    border: none;
    padding: 0;
    flex: none;
    width: 100%;
}
.room-team-1v1 .room-team-head {
    display: none !important;
}
.room-team-1 { border-color: rgba(52, 211, 153, 0.22); }
.room-team-2 { border-color: rgba(34, 211, 238, 0.22); }
.room-team-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.1rem 0.3rem;
    flex-shrink: 0;
}
.room-team-name {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-1);
    min-width: 0;
}
.room-team-name > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.room-team-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}
.room-team-1 .room-team-dot { color: #4ade80; }
.room-team-2 .room-team-dot { color: #22d3ee; }
.room-team-sub {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.room-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-3);
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    padding: 0.16rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.3;
    white-space: nowrap;
}
.room-chip-green { color: #4ade80; background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.24); }
.room-chip-blue { color: #22d3ee; background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.24); }
.room-chip-you { color: #0a0a0a; background: var(--accent); border-color: transparent; }

.room-seats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    align-content: center;
}
.room-team-1v1 .room-seats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    width: 100%;
    max-width: 100%;
}
.room-team-1v1 .room-seat {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.room-seat-1v1 {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 6rem !important;
    padding: 0.75rem 0.6rem !important;
    gap: 0 !important;
}
.room-seat-1v1 .room-seat-part-avatar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.room-seat-1v1 .room-seat-avatar {
    width: 3.8rem;
    height: 3.8rem;
    margin-bottom: 0;
}
.room-seat-part-divider {
    width: 1px;
    height: 3.8rem;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.4rem;
    flex-shrink: 0;
}
.room-seat-me .room-seat-part-divider {
    background: rgba(52, 211, 153, 0.35);
}
.room-seat-1v1 .room-seat-part-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    text-align: center;
}
.room-seat-1v1 .room-seat-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-1);
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
}
.room-seat-1v1 .room-seat-status-box {
    display: flex;
    align-items: center;
    justify-content: center;
}
.room-seat-1v1 .room-seat-tags {
    justify-content: center;
    gap: 0.3rem;
}
.room-seat-1v1.room-seat-empty {
    min-height: 6rem !important;
    padding: 0.75rem 0.6rem !important;
}
.room-seat-1v1.room-seat-empty .room-empty-ico {
    width: 3.4rem;
    height: 3.4rem;
}
.room-seat-1v1.room-seat-empty .room-seat-part-divider {
    border-right: 1px dashed rgba(255, 255, 255, 0.12);
    background: transparent;
    height: 3.4rem;
}
.room-seat-1v1.room-seat-empty .room-empty-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    text-align: center;
}
.room-seat-1v1.room-seat-empty .room-empty-sub {
    font-size: 0.65rem;
    color: #71717a;
    text-align: center;
}
.room-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.4rem;
    background: linear-gradient(180deg, rgba(30, 30, 36, 0.7) 0%, rgba(20, 20, 24, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    min-height: 7.2rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.room-seat-me {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, rgba(20, 28, 24, 0.95) 100%);
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.12);
    cursor: pointer;
}
.room-seat-me:active { transform: scale(0.98); }

.room-seat-avatar {
    position: relative;
    flex-shrink: 0;
    width: 3.35rem;
    height: 3.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: 2px;
    background: #27272a;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
}
.room-seat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
    background: #18181b;
    display: block;
}
.room-seat-avatar.seat-ready-ring {
    box-shadow: 0 0 0 2px #10b981, 0 0 14px rgba(16, 185, 129, 0.45);
}
.room-seat-level {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #18181b;
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.04rem 0.38rem;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1.2;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.room-seat-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
}
.room-seat-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}
.room-seat-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
}
.room-seat-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.14rem 0.45rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    white-space: nowrap;
    line-height: 1.25;
    flex-shrink: 0;
}
.room-seat-tag-me { color: #4ade80; background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.3); }
.room-seat-tag-team { color: #4ade80; background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.16); }
.room-seat-tag-opp { color: #94a3b8; background: rgba(148, 163, 184, 0.06); border-color: rgba(148, 163, 184, 0.16); }
.room-seat-tag-host { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.room-seat-tags {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.waiting-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.3;
}
.waiting-status-pill svg { width: 0.65rem; height: 0.65rem; }
.waiting-status-pill.ready {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.waiting-status-pill.waiting {
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

.room-seat-empty {
    background: rgba(255, 255, 255, 0.015);
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    box-shadow: none;
    justify-content: center;
    gap: 0.35rem;
}
.room-seat-empty-green {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.03);
}
.room-seat-empty-blue {
    border-color: rgba(34, 211, 238, 0.25);
    background: rgba(34, 211, 238, 0.03);
}
.room-empty-ico {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71717a;
    background: rgba(255, 255, 255, 0.03);
}
.room-empty-title {
    font-size: 0.62rem;
    font-weight: 700;
    color: #a1a1aa;
    text-align: center;
    line-height: 1.2;
}
.room-empty-sub {
    font-size: 0.52rem;
    color: #71717a;
    text-align: center;
    line-height: 1.2;
}



.room-vs {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.4rem;
    flex-shrink: 0;
}
.room-vs::before {
    content: '';
    position: absolute;
    inset-inline: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.55), rgba(34, 211, 238, 0.55), transparent);
}
.room-vs span {
    position: relative;
    z-index: 1;
    background: var(--bg-frame);
    padding: 0.16rem 1rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.25em;
    text-indent: 0.25em;
    color: var(--text-1);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.07);
}

#game-table-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-frame);
}

#opponents-container {
    flex-shrink: 0;
}

.domino-table-felt {
    flex: 1;
    min-height: 0;
    background-color: var(--felt);
    border: 2px solid var(--felt-border);
    position: relative;
    overflow: auto;
    border-radius: var(--radius-lg);
    margin: 0.25rem 0.35rem;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.domino-table-felt::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.domino-table-felt.felt-green {
    background: radial-gradient(ellipse at 50% 45%, #15737b 0%, #0d5259 60%, #073439 100%);
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.7), 0 4px 20px rgba(0, 0, 0, 0.5);
}
.domino-table-felt.felt-green::before {
    border: 1.5px dashed rgba(94, 234, 212, 0.25);
}

.domino-table-felt.felt-kurdish {
    background: 
        radial-gradient(ellipse at 50% 45%, rgba(69, 26, 3, 0.95) 0%, rgba(38, 13, 3, 0.98) 60%, rgba(21, 6, 1, 1) 100%),
        repeating-linear-gradient(45deg, rgba(217, 119, 6, 0.02) 0px, rgba(217, 119, 6, 0.02) 8px, transparent 8px, transparent 16px);
    border-color: #b45309;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(217, 119, 6, 0.15), 0 4px 22px rgba(0, 0, 0, 0.6);
}
.domino-table-felt.felt-kurdish::before {
    border: 1px dashed rgba(251, 191, 36, 0.18);
}

.domino-table-felt.felt-midnight,
.domino-table-felt.felt-obsidian {
    background: radial-gradient(ellipse at 50% 45%, #18181b 0%, #09090b 70%, #000000 100%);
    border-color: #3f3f46;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9), 0 4px 20px rgba(0, 0, 0, 0.65);
}
.domino-table-felt.felt-midnight::before,
.domino-table-felt.felt-obsidian::before {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.domino-table-felt.felt-ruby {
    background: radial-gradient(ellipse at 50% 45%, #450a0a 0%, #290505 70%, #120202 100%);
    border-color: #991b1b;
    box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.75), inset 0 0 14px rgba(239, 68, 68, 0.15), 0 4px 18px rgba(0, 0, 0, 0.5);
}

.domino-table-felt.felt-navy {
    background: radial-gradient(ellipse at 50% 45%, #0f2744 0%, #081729 70%, #030a13 100%);
    border-color: #1e40af;
    box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.7), inset 0 0 14px rgba(59, 130, 246, 0.15), 0 4px 18px rgba(0, 0, 0, 0.45);
}

.opp-player-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    transition: border-color 0.15s, background-color 0.15s;
    flex-shrink: 0;
    min-width: 0;                                                           
    overflow: hidden;                                                
}
.opp-player-card.active-turn {
    border-color: var(--accent);
}

#player-hand-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.3rem 0.25rem;
    min-height: 80px;
    touch-action: pan-x;
    scroll-behavior: smooth;
    justify-content: center;
}

.domino-tile-hand {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    transition: transform 0.12s ease;
    cursor: grab;
    flex-shrink: 0;
}
.domino-tile-hand:hover { transform: translateY(-4px); }
.domino-tile-hand:active { transform: translateY(-6px); cursor: grabbing; }

#btn-pass-turn {
    background-color: transparent;
    color: var(--red);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
#btn-pass-turn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.domino-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    width: 42px;
    height: 84px;
    pointer-events: none;
    touch-action: none;
    z-index: 9999;
    will-change: transform;
    filter: drop-shadow(0 14px 24px rgba(0,0,0,0.75)) drop-shadow(0 0 14px rgba(16,185,129,0.7));
}

.domino-flying-tile {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.domino-hand-tile {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#domino-board-svg {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

@keyframes cardPassFlash {
    0% { border-color: var(--red); }
    100% { border-color: var(--border); }
}
.card-pass-flash {
    animation: cardPassFlash 0.22s ease-out;
}

@keyframes cardDrawRed {
    0% { border-color: var(--red); }
    100% { border-color: var(--border); }
}
.card-draw-red {
    animation: cardDrawRed 0.22s ease-out;
}

.domino-tile-playable {
    transition: transform 0.15s ease-out;
}

.domino-tile-disabled {
    opacity: 0.7;
    filter: brightness(0.85) saturate(0.6);
    cursor: not-allowed;
}

#bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-nav);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.35rem clamp(0.25rem, 1.5vw, 0.5rem);
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    z-index: 40;
    user-select: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.3rem clamp(0.2rem, 1.2vw, 0.65rem);
    border-radius: var(--radius-md);
    color: var(--text-3);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.12s, transform 0.12s;
    flex: 1;
    min-width: 0;
}
.nav-item:hover { color: var(--text-2); }
.nav-item:active { transform: scale(0.94); }
.nav-item.active { color: var(--accent); }
.nav-label {
    font-size: clamp(0.52rem, 1.8vw, 0.62rem);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.btn-shadcn-primary {
    background-color: var(--accent);
    color: var(--bg-base);
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity 0.12s, transform 0.1s;
}
.btn-shadcn-primary:hover { opacity: 0.85; }
.btn-shadcn-primary:active { transform: scale(0.98); }

.btn-shadcn-secondary {
    background-color: var(--bg-card);
    color: var(--text-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s;
}
.btn-shadcn-secondary:hover { background-color: var(--bg-card-hover); }
.btn-shadcn-secondary:active { transform: scale(0.98); }

.btn-shadcn-outline {
    background-color: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
}
.btn-shadcn-outline:hover {
    background-color: var(--bg-card);
    color: var(--text-1);
}
.btn-shadcn-outline:active { transform: scale(0.98); }

.btn-shadcn-destructive {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s;
}
.btn-shadcn-destructive:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fff;
}
.btn-shadcn-destructive:active { transform: scale(0.98); }

.fixed.inset-0.z-50,
.fixed.inset-0.z-\[1000000\],
.fixed.inset-0:has(.animate-dialog) {
    padding: clamp(0.5rem, 2.5vw, 1rem) !important;
    padding-top: max(clamp(0.5rem, 2.5vw, 1rem), env(safe-area-inset-top)) !important;
    padding-bottom: max(clamp(0.5rem, 2.5vw, 1rem), env(safe-area-inset-bottom)) !important;
    padding-left: max(clamp(0.5rem, 2.5vw, 1rem), env(safe-area-inset-left)) !important;
    padding-right: max(clamp(0.5rem, 2.5vw, 1rem), env(safe-area-inset-right)) !important;
    box-sizing: border-box;
}

.modal-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-1);
    outline: none;
    transition: border-color 0.12s;
}
.modal-input:focus { border-color: var(--border-focus); }
.modal-input::placeholder { color: var(--text-3); }

.modal-close-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s;
}
.modal-close-btn:hover { color: var(--text-1); }

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-dialog {
    animation: modalFadeIn 0.2s ease-out forwards;
    width: 100% !important;
    max-width: min(calc(100vw - 1rem), 400px) !important;
    max-height: min(90dvh, 640px) !important;
    padding: clamp(0.75rem, 3.2vw, 1.25rem) !important;
    box-sizing: border-box !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.animate-dialog.max-w-xs {
    max-width: min(calc(100vw - 1rem), 330px) !important;
}

.create-room-score-btn {
    padding: 0.5rem clamp(0.2rem, 1.2vw, 0.5rem) !important;
    font-size: clamp(0.55rem, 2vw, 0.65rem) !important;
    white-space: nowrap;
}

.create-room-timer-btn,
.create-room-stake-btn {
    padding: 0.45rem clamp(0.15rem, 1vw, 0.4rem) !important;
    font-size: clamp(0.55rem, 2vw, 0.62rem) !important;
}

#lucky-wheel-canvas {
    max-width: min(260px, 68vw);
    max-height: min(260px, 68vw);
    width: auto;
    height: auto;
    aspect-ratio: 1/1;
}

@keyframes tabFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes tabSlideForward {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes tabSlideBackward {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.tab-view-enter-active {
    animation: tabFadeIn 0.18s ease-out forwards;
}
.tab-view-enter-forward {
    animation: tabSlideForward 0.2s ease-out forwards;
}
.tab-view-enter-backward {
    animation: tabSlideBackward 0.2s ease-out forwards;
}

@keyframes tileDraw {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}
.animate-tile-draw {
    animation: tileDraw 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes tilePlace {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-tile-place {
    animation: tilePlace 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-box: fill-box;
    transform-origin: center;
}

.speech-bubble-kurdish {
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) scale(1);
    transform-origin: bottom center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(16, 185, 129, 0.25);
    animation: speechBubblePop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.speech-bubble-kurdish::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--bg-card) transparent transparent transparent;
}
@keyframes speechBubblePop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.6) translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.voice-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s;
}
.voice-btn-active {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}
.voice-btn-muted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}
.voice-btn-mini {
    padding: 0.15rem 0.3rem;
    border-radius: var(--radius-sm);
    gap: 0.15rem;
}
.voice-btn-mini:hover { background: var(--bg-card-hover); }
.voice-btn-mini:active { transform: scale(0.95); }
.voice-btn-mini.voice-btn-active {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}
.voice-btn-mini.voice-btn-muted,
.voice-btn-mini.voice-btn-deafened {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}
.voice-btn-table {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    border-radius: var(--radius-sm);
    gap: 0.2rem;
}
.voice-btn-table:hover { background: var(--bg-card-hover); }
.voice-btn-table.voice-btn-active {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}
.voice-btn-table.voice-btn-muted {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}

.room-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-2);
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
}
.room-filter-pill:hover {
    color: var(--text-1);
    border-color: rgba(201, 169, 110, 0.4);
}
.room-filter-pill.active {
    background: rgba(201, 169, 110, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

.player-pod-mic-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 9999px;
    background: #18181b;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.15s ease;
}
.player-pod-mic-badge.active {
    background: #064e3b;
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}
.player-pod-mic-badge.muted {
    background: #450a0a;
    border-color: #f87171;
    color: #f87171;
}
.player-pod-mic-badge.speaking {
    background: #059669;
    border-color: #6ee7b7;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(110, 231, 183, 0.8);
    animation: pulse 1s infinite;
}

.voice-speaking-glow {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.6), 0 0 16px rgba(34, 197, 94, 0.8) !important;
    border-color: #22c55e !important;
    transition: box-shadow 0.15s ease;
}

.chat-bar-circle-btn.voice-btn-active {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #4ade80 !important;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}
.chat-bar-circle-btn.voice-btn-muted,
.chat-bar-circle-btn.voice-btn-deafened {
    background: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
}

.profile-banner-kurdish {
    background: linear-gradient(135deg, #092014 0%, #0d151c 50%, #1a160d 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    height: clamp(80px, 15vh, 120px);
}
.profile-banner-kurdish::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(201, 169, 110, 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}
.stat-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.4rem;
    text-align: center;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.stat-box:hover {
    border-color: rgba(201, 169, 110, 0.3);
    background-color: var(--bg-card-hover);
}
.profile-hub-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}
.profile-hub-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(201, 169, 110, 0.35);
    transform: translateY(-1px);
}
.profile-hub-card:active {
    transform: scale(0.98);
}
.profile-hub-card h4,
.profile-hub-card p {
    line-height: 1.7;
}
.vip-progress-bar-container {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 9999px;
    height: 7px;
    overflow: hidden;
    position: relative;
}
.vip-progress-bar-fill {
    background: linear-gradient(90deg, #c9a96e 0%, #fbbf24 100%);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}
.chat-bubble-outgoing {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.12) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #f0fdf4;
    border-radius: 1.1rem 1.1rem 0.25rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    word-break: break-word;
}
.chat-bubble-incoming {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-1);
    border-radius: 1.1rem 1.1rem 1.1rem 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    word-break: break-word;
}
.friend-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.friend-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(201, 169, 110, 0.25);
}
.search-user-card,
.suggested-user-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.search-user-card:hover,
.suggested-user-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(201, 169, 110, 0.25);
}
.btn-search-send-request,
.btn-add-suggested {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--gold);
    color: #111111;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.12s;
    border: none;
}
.btn-search-send-request:hover,
.btn-add-suggested:hover {
    filter: brightness(1.1);
}
.btn-search-send-request:active,
.btn-add-suggested:active {
    transform: scale(0.96);
}
.btn-pending-request {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-3);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: not-allowed;
}
.avatar-select-item {
    cursor: pointer;
    border-radius: 9999px;
    padding: 2px;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}
.avatar-select-item:hover {
    border-color: var(--text-3);
    transform: scale(1.05);
}
.avatar-select-item.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-bg);
}

.chat-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.chat-search-icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.chat-search-input {
    width: 100%;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 2.2rem 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    color: var(--text-1) !important;
    outline: none !important;
    transition: border-color 0.12s;
}
.chat-search-input:focus { border-color: var(--border-focus) !important; }

.typing-dots { display: inline-flex; align-items: center; gap: 3px; }
.typing-dot {
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-3px); opacity: 1; }
}

.nav-icon-container {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.nav-item.active .nav-icon-container { color: var(--accent); }

.subtab-chat-btn {
    transition: all 0.12s;
    padding: 0.45rem clamp(0.15rem, 1vw, 0.4rem) !important;
    gap: 0.25rem !important;
    min-width: 0;
}
.subtab-chat-btn span {
    font-size: clamp(0.55rem, 2vw, 0.65rem) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.subtab-chat-btn svg {
    width: clamp(0.75rem, 2.5vw, 0.875rem) !important;
    height: clamp(0.75rem, 2.5vw, 0.875rem) !important;
}
.store-tab-btn { transition: all 0.12s; }
.create-room-mode-card { transition: all 0.12s; }
.create-room-score-btn { transition: all 0.12s; }
.create-room-stake-btn { transition: all 0.12s; }
.in-game-reaction-btn { transition: all 0.1s; }

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    border-radius: 12px;
    object-fit: contain;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}


.bg-warm-base { background-color: var(--bg-base); }
.bg-warm-frame { background-color: var(--bg-frame); }
.bg-warm-card { background-color: var(--bg-card); }
.bg-warm-card-hover { background-color: var(--bg-card-hover); }
.bg-warm-input { background-color: var(--bg-input); }
.bg-warm-nav { background-color: var(--bg-nav); }
.bg-warm-gold { background-color: var(--gold); }
.bg-warm-green { background-color: var(--green); }
.bg-warm-red { background-color: var(--red); }
.bg-warm-amber { background-color: #d97706; }
.bg-warm-gold-10 { background-color: var(--gold-bg); }
.bg-warm-gold-15 { background-color: rgba(201, 169, 110, 0.15); }
.bg-warm-red-10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-warm-green-10 { background-color: rgba(34, 197, 94, 0.1); }
.bg-warm-blue-10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-warm-gold-80 { background-color: rgba(201, 169, 110, 0.8); }
.bg-warm-green-80 { background-color: rgba(34, 197, 94, 0.8); }

.text-warm-gold { color: var(--gold); }
.text-warm-red { color: var(--red); }
.text-warm-green { color: var(--green); }
.text-warm-blue { color: var(--blue); }
.text-warm-light { color: var(--text-1); }
.text-warm-mid { color: var(--text-2); }
.text-warm-dim { color: var(--text-3); }
.text-warm-dark { color: var(--bg-base); }

.border-warm-gold { border-color: var(--gold); }
.border-warm-frame { border-color: var(--bg-frame); }
.border-warm-green { border-color: rgba(34, 197, 94, 0.3); }
.border-warm-gold-20 { border-color: rgba(201, 169, 110, 0.2); }
.border-warm-gold-30 { border-color: rgba(201, 169, 110, 0.3); }
.border-warm-red-30 { border-color: rgba(239, 68, 68, 0.3); }
.border-warm-green-30 { border-color: rgba(34, 197, 94, 0.3); }
.border-warm-blue-40 { border-color: rgba(59, 130, 246, 0.4); }

.accent-warm-gold { accent-color: var(--gold); }
.placeholder-warm-dim::placeholder { color: var(--text-3); }

.warm-gold { color: var(--gold); }
.warm-gold-bg { background-color: var(--gold); }
.warm-red { color: var(--red); }
.warm-green { color: var(--green); }
.warm-blue { color: var(--blue); }
.warm-muted { color: var(--text-3); }
.warm-surface { color: var(--text-2); }

.bg-\[#0f0d0a\] { background-color: var(--bg-base); }
.bg-\[#171412\] { background-color: var(--bg-frame); }
.bg-\[#1e1a17\] { background-color: var(--bg-card); }
.bg-\[#262119\] { background-color: var(--bg-card-hover); }
.bg-\[#12100d\] { background-color: var(--bg-input); }
.bg-\[#1a1714\] { background-color: var(--bg-nav); }
.bg-\[#09090b\] { background-color: var(--bg-base); }

.bg-\[#c9a96e\]/10 { background-color: var(--accent-bg); }
.bg-\[#c9a96e\]/15 { background-color: rgba(250, 250, 250, 0.12); }
.bg-\[#c97070\]/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-\[#c97070\]/15 { background-color: rgba(239, 68, 68, 0.15); }
.bg-\[#7cb583\]/10 { background-color: rgba(34, 197, 94, 0.1); }
.bg-\[#70a5c9\]/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-\[#c9a96e\]/5 { background-color: rgba(250, 250, 250, 0.05); }
.bg-\[#c9a96e\]/5 { background-color: rgba(201, 169, 110, 0.05); }

.text-\[#c9a96e\] { color: var(--gold); }
.text-\[#c97070\] { color: var(--red); }
.text-\[#7cb583\] { color: var(--green); }
.text-\[#70a5c9\] { color: var(--blue); }
.text-\[#0f0d0a\] { color: var(--bg-base); }
.text-\[#e8e2d8\] { color: var(--text-1); }
.text-\[#9e9688\] { color: var(--text-2); }
.text-\[#6b6358\] { color: var(--text-3); }

.border-\[#c9a96e\] { border-color: var(--gold); }
.border-\[#a68b55\] { border-color: var(--gold-dim); }
.border-\[#c9a96e\]/20 { border-color: rgba(201, 169, 110, 0.2); }
.border-\[#c9a96e\]/30 { border-color: rgba(201, 169, 110, 0.3); }
.border-\[#c9a96e\]/40 { border-color: rgba(201, 169, 110, 0.4); }
.border-\[#c97070\]/30 { border-color: rgba(239, 68, 68, 0.3); }
.border-\[#7cb583\]/30 { border-color: rgba(34, 197, 94, 0.3); }
.border-\[#70a5c9\]/40 { border-color: rgba(59, 130, 246, 0.4); }
.border-\[#a68b55\]/30 { border-color: rgba(166, 139, 85, 0.3); }

.ring-\[#c9a96e\]/40 { --tw-ring-color: rgba(201, 169, 110, 0.4); }

.hover\:bg-\[#262119\]:hover { background-color: var(--bg-card-hover); }
.hover\:bg-\[#c9a96e\]/80:hover { background-color: rgba(201, 169, 110, 0.8); }
.hover\:bg-\[#7cb583\]/80:hover { background-color: rgba(34, 197, 94, 0.8); }
.hover\:text-\[#c9a96e\]:hover { color: var(--gold); }
.hover\:text-\[#9e9688\]:hover { color: var(--text-2); }

.active\:scale-95:active { transform: scale(0.95); }
.active\:scale-\[0\.98\]:active { transform: scale(0.98); }

.warm-dark-surface { background-color: var(--bg-card); }
.warm-darker-surface { background-color: var(--bg-card-hover); }
.warm-darkest { background-color: var(--bg-base); }
.warm-frame { background-color: var(--bg-frame); }
.warm-nav { background-color: var(--bg-nav); }
.warm-input { background-color: var(--bg-input); }

.border-theme { border-color: var(--border); }
.border-t-theme { border-top-color: var(--border); }
.border-b-theme { border-bottom-color: var(--border); }

.border-l-w8 { border-left-width: 8px; }
.border-r-w8 { border-right-width: 8px; }
.border-t-w14 { border-top-width: 14px; }
.border-t-warm-gold { border-top-color: var(--gold); }

.revealed-tile-item {
    width: 22px !important;
    height: 44px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex: 0 0 22px !important;
    display: inline-block !important;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
    background: #e8e3d9;
    vertical-align: middle;
}
.revealed-tile-item svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.revealed-tiles-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    align-items: center !important;
    padding: 3px 0 !important;
    max-width: 100% !important;
}

.open-room-lounge-card {
    background: linear-gradient(135deg, rgba(28, 28, 34, 0.95) 0%, rgba(18, 18, 22, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
}
.open-room-lounge-card:hover {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, rgba(34, 36, 44, 0.98) 0%, rgba(22, 24, 30, 1) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.1);
}
.open-room-lounge-card:active {
    transform: scale(0.99);
}

.room-card-avatar-box {
    width: 2.6rem;
    height: 2.6rem;
    min-width: 2.6rem;
    min-height: 2.6rem;
    position: relative;
    flex-shrink: 0;
}
.room-card-avatar-img {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 9999px;
    object-fit: cover;
    background: #18181b;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    display: block;
}
.room-card-crown {
    position: absolute;
    top: -4px;
    right: -2px;
    width: 1.05rem;
    height: 1.05rem;
    background: #1c1917;
    border: 1.5px solid #f59e0b;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    z-index: 2;
}
.room-card-crown svg {
    width: 0.65rem;
    height: 0.65rem;
}
.room-card-online-dot {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border: 1.5px solid #18181b;
    border-radius: 9999px;
    z-index: 2;
}

.room-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}
.room-card-hostname {
    font-weight: 700;
    font-size: 0.75rem;
    color: #f4f4f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.room-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1.3;
}
.room-pill-players {
    background: rgba(39, 39, 42, 0.7);
    color: #e4e4e7;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.room-seats-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 2px;
}
.room-seat-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    vertical-align: middle;
}
.room-seat-dot.occupied {
    background: #10b981;
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.9);
}
.room-seat-dot.empty {
    background: rgba(82, 82, 91, 0.7);
    border: 1px dashed rgba(161, 161, 170, 0.6);
}

.lounge-join-btn, .room-btn-join {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.lounge-join-btn:hover, .room-btn-join:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
    transform: scale(1.02);
}
.lounge-join-btn:active, .room-btn-join:active {
    transform: scale(0.97);
}

#waiting-friend-code-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(24, 24, 28, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 0.45rem 0.75rem;
    margin-top: 0.4rem;
}
#btn-copy-room-code {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 0.22rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
#btn-copy-room-code:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}
#input-join-room-code {
    background: #09090b;
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    letter-spacing: 0.25em;
    font-family: monospace;
    font-weight: 800;
    font-size: 1.35rem;
    text-align: center;
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#input-join-room-code:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    outline: none;
}

.player-speech-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #18181b;
    color: #fbbf24;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    padding: 0.35rem 0.65rem;
    border-radius: 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    z-index: 60;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
    animation: speechBubblePop 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.player-speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(245, 158, 11, 0.4) transparent transparent transparent;
}
@keyframes speechBubblePop {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.85); }
    10% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -10px) scale(0.95); }
}

.throwable-projectile {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    animation: throwableArcFlight 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

@keyframes throwableArcFlight {
    0% {
        transform: translate(0, 0) scale(0.7) rotate(0deg);
        opacity: 0.8;
    }
    40% {
        transform: translate(calc(var(--dx) * 0.45), calc(var(--dy) * 0.45 - 75px)) scale(1.35) rotate(160deg);
        opacity: 1;
    }
    85% {
        transform: translate(calc(var(--dx) * 0.9), calc(var(--dy) * 0.9 - 15px)) scale(1.1) rotate(310deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1) rotate(360deg);
        opacity: 1;
    }
}

.throwable-impact {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    animation: throwableImpactBurst 0.65s ease-out forwards;
}

@keyframes throwableImpactBurst {
    0% {
        transform: scale(0.3) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.4) rotate(15deg);
        opacity: 1;
    }
    70% {
        transform: scale(1.1) rotate(-5deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.6) rotate(30deg);
        opacity: 0;
    }
}

.gift-target-celebrating {
    position: relative;
    animation: giftTargetPulse 1.2s ease-in-out;
}

@keyframes giftTargetPulse {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.06); }
    60% { transform: scale(0.98); }
}

.gift-celebration-banner {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-24px);
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 9999px;
    background: rgba(18, 18, 24, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 158, 11, 0.2);
    color: #f4f4f5;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    animation: bannerSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 90vw;
    white-space: nowrap;
}

.gift-celebration-banner.banner-exit {
    animation: bannerSlideOut 0.35s ease-in forwards;
}

.gift-celebration-banner .sender-badge,
.gift-celebration-banner .target-badge {
    color: #fbbf24;
    font-weight: 700;
}

.gift-celebration-banner .banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-24px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes bannerSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.94);
    }
}

.throwable-recipient-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d4d4d8;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.throwable-recipient-chip img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.throwable-recipient-chip.selected {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}

.gift-bubble {
    position: absolute;
    bottom: 105%;
    left: auto;
    right: 50%;
    transform: translateX(50%);
    background: rgba(18, 18, 22, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef08a;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: bubblePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bubblePop {
    0% { transform: translateX(50%) scale(0.6); opacity: 0; }
    100% { transform: translateX(50%) scale(1); opacity: 1; }
}


.room-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.35rem, 1vh, 0.5rem) clamp(0.4rem, 2vw, 0.75rem);
    padding-top: max(clamp(0.35rem, 1vh, 0.5rem), env(safe-area-inset-top));
    padding-left: max(clamp(0.4rem, 2vw, 0.75rem), env(safe-area-inset-left));
    padding-right: max(clamp(0.4rem, 2vw, 0.75rem), env(safe-area-inset-right));
    background: linear-gradient(180deg, rgba(20, 20, 25, 0.98) 0%, rgba(15, 15, 18, 0.95) 100%);
    border-bottom: 1px solid var(--border);
    z-index: 30;
    flex-shrink: 0;
    gap: clamp(0.25rem, 1.5vw, 0.5rem);
    user-select: none;
}

.room-currency-capsule {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem clamp(0.35rem, 1.2vw, 0.65rem);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 9999px;
    color: #fbbf24;
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    font-weight: 800;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.room-currency-capsule:hover {
    border-color: rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.18);
}
.room-currency-capsule:active {
    transform: scale(0.96);
}

.room-header-actions {
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 1vw, 0.35rem);
}

.room-header-icon-btn {
    width: clamp(1.6rem, 4.5vw, 1.85rem);
    height: clamp(1.6rem, 4.5vw, 1.85rem);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.room-header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-1);
    border-color: rgba(255, 255, 255, 0.2);
}
.room-header-icon-btn:active {
    transform: scale(0.92);
}

.room-ping-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.45rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: monospace;
}

.room-spec-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.45rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: monospace;
}

.waiting-hero-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(0.35rem, 1.5vh, 0.85rem) 0.5rem clamp(0.2rem, 0.8vh, 0.45rem);
    gap: clamp(0.2rem, 0.8vh, 0.45rem);
    user-select: none;
}

.waiting-hero-art {
    width: clamp(112px, 30vw, 190px);
    height: auto;
    max-height: clamp(96px, 21vh, 168px);
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
    animation: heroFloat 4s ease-in-out infinite alternate;
}
@keyframes heroFloat {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-4px) scale(1.02); }
}

.badge-domino-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.12rem 0.85rem;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.2) 0%, rgba(16, 185, 129, 0.3) 50%, rgba(20, 184, 166, 0.2) 100%);
    border: 1px solid rgba(45, 212, 191, 0.6);
    border-radius: 9999px;
    color: #5eead4;
    font-size: clamp(0.66rem, 1.8vw, 0.75rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.3);
}

.waiting-hero-status {
    font-size: clamp(0.68rem, 1.8vw, 0.78rem);
    font-weight: 600;
    color: #a1a1aa;
}

.waiting-action-pills {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.4rem, 1.8vw, 0.7rem);
    width: 100%;
    max-width: 440px;
    padding: 0;
    user-select: none;
}

.btn-room-ready-pill {
    flex: 1;
    max-width: 170px;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(180deg, rgba(20, 140, 170, 0.55) 0%, rgba(10, 92, 116, 0.55) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1.5px solid rgba(45, 212, 191, 0.5);
    box-shadow: 0 5px 16px rgba(6, 78, 92, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-room-ready-pill > i,
.btn-room-ready-pill > svg,
.btn-room-invite-pill > i,
.btn-room-invite-pill > svg,
.btn-room-ready-pill span > i,
.btn-room-ready-pill span > svg {
    flex-shrink: 0;
}
.btn-room-ready-pill:hover {
    background: linear-gradient(180deg, rgba(24, 165, 199, 0.68) 0%, rgba(13, 110, 138, 0.68) 100%);
    border-color: rgba(94, 234, 212, 0.8);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}
.btn-room-ready-pill:active {
    transform: scale(0.96);
}
.btn-room-ready-pill.is-ready {
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 60%, #0f766e 100%);
    color: #ffffff;
    border-color: rgba(94, 234, 212, 0.8);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.btn-room-invite-pill {
    flex: 1;
    max-width: 170px;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(180deg, rgba(201, 169, 110, 0.26) 0%, rgba(150, 122, 72, 0.24) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ecd9ad;
    border: 1.5px solid rgba(201, 169, 110, 0.55);
    box-shadow: 0 5px 16px rgba(90, 68, 30, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-room-invite-pill:hover {
    background: linear-gradient(180deg, rgba(214, 184, 128, 0.4) 0%, rgba(166, 139, 85, 0.38) 100%);
    border-color: rgba(232, 213, 168, 0.85);
    color: #f7ecce;
    box-shadow: 0 6px 20px rgba(201, 169, 110, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}
.btn-room-invite-pill:active {
    transform: scale(0.96);
}

.waiting-grid-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.35rem, 1.5vw, 0.75rem);
    box-sizing: border-box;
}

.waiting-unified-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 440px;
    margin: 0.35rem auto;
    padding: clamp(0.45rem, 1.2vh, 0.65rem) clamp(0.35rem, 1.8vw, 0.65rem);
    background: linear-gradient(180deg, rgba(26, 26, 32, 0.9) 0%, rgba(16, 16, 20, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    user-select: none;
    position: relative;
}

.waiting-team-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.waiting-team-title {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: clamp(0.58rem, 1.6vw, 0.65rem);
    font-weight: 800;
    margin-bottom: 0.3rem;
    padding: 0.08rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.waiting-team-side-my .waiting-team-title {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.3);
}

.waiting-team-side-opp .waiting-team-title {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.3);
}

.waiting-seats-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.2rem, 1.5vw, 0.5rem);
    width: 100%;
}

.waiting-vs-badge-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.2rem, 1vw, 0.45rem);
    flex-shrink: 0;
    position: relative;
}

.waiting-vs-circle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: clamp(0.55rem, 1.6vw, 0.62rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #fbbf24;
    background: #18181b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
    padding: 0.08rem 0.45rem;
    border-radius: 9999px;
}

.waiting-unified-card-1v1 {
    justify-content: space-around;
}

.waiting-seat-solo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.seat-role-pill {
    font-size: clamp(0.52rem, 1.5vw, 0.58rem);
    font-weight: 800;
    padding: 0.05rem 0.4rem;
    border-radius: 9999px;
    line-height: 1.2;
    margin-top: -0.1rem;
}
.seat-role-me {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
}
.seat-role-teammate {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.28);
}
.seat-role-opponent {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.28);
}
.seat-role-empty {
    color: #71717a;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.room-seats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    padding: clamp(0.35rem, 1vh, 0.75rem) clamp(0.25rem, 1vw, 0.5rem);
    gap: clamp(0.25rem, 1.5vw, 0.5rem);
    user-select: none;
}

.room-seat-pod {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    max-width: clamp(64px, 20vw, 76px);
    min-width: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.room-seat-pod:active {
    transform: scale(0.95);
}

.seat-avatar-wrap {
    position: relative;
    width: clamp(2.35rem, 5.8vh, 2.9rem);
    height: clamp(2.35rem, 5.8vh, 2.9rem);
    border-radius: 9999px;
    border: 2.5px solid rgba(45, 212, 191, 0.65);
    background: #082f36;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.seat-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}

.seat-ready-check {
    position: absolute;
    top: -3px;
    left: -3px;
    width: clamp(1rem, 2.5vh, 1.2rem);
    height: clamp(1rem, 2.5vh, 1.2rem);
    border-radius: 9999px;
    background: #22c55e;
    color: #ffffff;
    border: 2px solid #08323a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
    z-index: 5;
}

.seat-empty-circle {
    width: clamp(2.35rem, 5.8vh, 2.9rem);
    height: clamp(2.35rem, 5.8vh, 2.9rem);
    border-radius: 9999px;
    background: rgba(14, 116, 144, 0.45);
    border: 2px solid rgba(45, 212, 191, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.15s ease;
}
.seat-empty-circle:hover {
    background: rgba(14, 116, 144, 0.7);
    border-color: rgba(94, 234, 212, 0.9);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.45);
}

.seat-player-name {
    font-size: clamp(0.6rem, 1.8vw, 0.68rem);
    font-weight: 700;
    color: var(--text-1);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.seat-empty-stake {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: clamp(0.58rem, 1.6vw, 0.65rem);
    font-weight: 800;
    color: #fbbf24;
    font-family: monospace;
    line-height: 1.2;
}

.live-chat-floating-overlay {
    position: absolute;
    bottom: calc(100% + 1.35rem);
    right: 0.55rem;
    left: 0.55rem;
    z-index: 30;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 290px;
}

.chat-bar-circle-btn.chat-bar-chat-toggle.is-open {
    background: rgba(201, 169, 110, 0.18) !important;
    border-color: rgba(201, 169, 110, 0.55) !important;
    color: #c9a96e !important;
    box-shadow: 0 0 8px rgba(201, 169, 110, 0.3);
}

.live-chat-stream {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 8rem;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: thin;
}

.live-chat-bubble-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    animation: bubbleSlide 0.2s ease-out;
}
@keyframes bubbleSlide {
    0% { transform: translateY(4px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.live-chat-bubble-item .chat-avatar {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 9999px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    object-fit: cover;
    flex-shrink: 0;
}

.live-chat-bubble-item .chat-content {
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.68rem;
    color: #f4f4f5;
    max-width: 220px;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.live-chat-bubble-item .chat-author {
    font-size: 0.62rem;
    font-weight: 700;
    color: #fbbf24;
    margin-left: 0.25rem;
}

.table-chat-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1.2vw, 0.4rem);
    padding: 0.4rem clamp(0.35rem, 1.5vw, 0.65rem);
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(20, 20, 25, 0.95) 0%, rgba(15, 15, 18, 0.98) 100%);
    border-top: 1px solid var(--border);
    z-index: 35;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
}

.chat-bar-circle-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.chat-bar-circle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-1);
    border-color: rgba(255, 255, 255, 0.25);
}
.chat-bar-circle-btn:active {
    transform: scale(0.92);
}

.chat-bar-input {
    flex: 1;
    min-width: 0;
    background: rgba(24, 24, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.72rem;
    color: #f4f4f5;
    outline: none;
    transition: border-color 0.15s ease;
}
.chat-bar-input::placeholder {
    color: #71717a;
}
.chat-bar-input:focus {
    border-color: rgba(245, 158, 11, 0.6);
    background: rgba(30, 30, 36, 0.95);
}

.table-players-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    width: 100%;
    padding: clamp(0.25rem, 0.8vh, 0.45rem) clamp(0.25rem, 1vw, 0.5rem);
    background: linear-gradient(180deg, rgba(18, 18, 22, 0.92) 0%, rgba(12, 12, 15, 0.85) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 25;
    flex-shrink: 0;
    user-select: none;
}

.table-pod {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    max-width: clamp(60px, 22vw, 78px);
    min-width: 0;
    flex: 1;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.table-pod:active {
    transform: scale(0.95);
}

.table-pod-avatar-ring {
    position: relative;
    width: clamp(2.3rem, 5.5vh, 2.85rem);
    height: clamp(2.3rem, 5.5vh, 2.85rem);
    border-radius: 9999px;
    border: 2px solid rgba(245, 158, 11, 0.45);
    background: #18181b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
}
.table-pod-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}
.table-pod-avatar-ring.active-turn {
    border-color: #10b981;
    box-shadow: 0 0 0 2px #10b981, 0 0 12px rgba(16, 185, 129, 0.55);
    animation: turnPulse 2.4s ease-in-out infinite;
}
@keyframes turnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.045); }
}

.table-pod-avatar-ring.speaking {
    box-shadow: 0 0 0 2px #22d3ee, 0 0 14px rgba(34, 211, 238, 0.7);
}

.turn-pointer-triangle {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #a3e635;
    filter: drop-shadow(0 0 6px rgba(163, 230, 53, 0.95));
    z-index: 20;
    pointer-events: none;
}

.table-pod-countdown-overlay {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8;
    pointer-events: none;
}
.table-pod-countdown-number {
    font-family: monospace, system-ui;
    font-size: clamp(0.95rem, 2.8vw, 1.25rem);
    font-weight: 900;
    color: #facc15;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(250, 204, 21, 0.7);
    line-height: 1;
}

.table-domino-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: auto;
    right: -8px;
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 60%, #9a3412 100%);
    border: 1px solid #fed7aa;
    border-radius: 4px;
    padding: 0.12rem 0.25rem;
    font-size: clamp(0.6rem, 1.8vw, 0.68rem);
    font-weight: 900;
    color: #ffffff;
    font-family: monospace;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0.95rem;
    z-index: 10;
}

.table-pod-name {
    font-size: clamp(0.58rem, 1.8vw, 0.66rem);
    font-weight: 700;
    color: var(--text-1);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    margin-top: 0.15rem;
    line-height: 1.6;
}

.table-pod-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 47, 54, 0.85);
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 9999px;
    padding: 0.05rem clamp(0.3rem, 1.2vw, 0.5rem);
    font-size: clamp(0.55rem, 1.8vw, 0.64rem);
    font-weight: 800;
    color: #2dd4bf;
    font-family: monospace;
    margin-top: 0.12rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.table-pod-score .score-current {
    color: #fbbf24;
}
.table-pod-score .score-target {
    color: #2dd4bf;
}

.boneyard-box-widget {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease;
}
.boneyard-box-widget:active {
    transform: translateY(-50%) scale(0.94);
}

.boneyard-box-img {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
}

.boneyard-badge-domino {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #d97706 0%, #b45309 60%, #78350f 100%);
    border: 1px solid #fbbf24;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fffbeb;
    font-family: monospace;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    min-width: 1.2rem;
    text-align: center;
}

.domino-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 6vw, 2.7rem);
    font-weight: 700;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.05);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 -1px 1px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}


@media (max-width: 360px) {
    #main-app-header {
        padding: 0.35rem 0.5rem;
    }

    #top-user-name {
        max-width: 80px;
    }

    .currency-pill-gold,
    .currency-pill-cyan {
        padding: 0.2rem 0.4rem;
        font-size: 0.62rem;
    }

    .game-hero-banner {
        padding: 0.65rem 0.75rem;
    }

    .game-mode-tile {
        padding: 0.5rem 0.35rem;
    }

    .quick-action-pill {
        padding: 0.35rem 0.2rem;
    }

    .waiting-team-partition {
        padding: 0.35rem;
    }

    .room-seat-pod {
        width: 3.2rem;
    }

    .seat-avatar-wrap,
    .seat-empty-circle {
        width: 2.35rem;
        height: 2.35rem;
    }

    .seat-player-name {
        font-size: 0.58rem;
    }

    .table-players-top-row {
        padding: 0.2rem 0.25rem;
    }

    .table-pod {
        max-width: 58px;
    }

    .table-pod-avatar-ring {
        width: 2.15rem;
        height: 2.15rem;
    }

    .table-domino-badge {
        font-size: 0.52rem;
        padding: 0.05rem 0.2rem;
    }

    .table-pod-name {
        font-size: 0.55rem;
    }

    .table-pod-score {
        font-size: 0.52rem;
        padding: 0.04rem 0.25rem;
    }

    .chat-bar-circle-btn {
        width: 1.75rem;
        height: 1.75rem;
    }

    .chat-bar-input {
        font-size: 0.68rem;
        padding: 0.3rem 0.6rem;
    }

    .boneyard-box-img {
        width: 2.2rem;
        height: 2.2rem;
    }

    .boneyard-badge-domino {
        font-size: 0.6rem;
        padding: 0.08rem 0.35rem;
    }

    .animate-dialog {
        padding: 0.65rem !important;
    }

    .modal-input {
        padding: 0.45rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-height: 700px) {
    #main-app-header {
        padding-top: max(0.25rem, env(safe-area-inset-top));
        padding-bottom: 0.25rem;
    }

    #game-lobby-view {
        gap: 0.45rem;
        padding: 0.5rem;
    }

    .lobby-welcome-banner {
        padding: 0.45rem 0.65rem;
    }

    .game-hero-banner {
        padding: 0.5rem 0.75rem;
    }

    .waiting-hero-area {
        padding: 0.25rem 0.5rem;
    }

    .waiting-unified-card {
        padding: 0.35rem 0.45rem;
        margin: 0.2rem auto;
    }

    .waiting-actions-bottom {
        padding: 0.35rem 0.65rem;
        gap: 0.35rem;
    }

    #btn-toggle-ready {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .table-players-top-row {
        padding: 0.2rem 0.35rem;
    }

    .table-pod-avatar-ring {
        width: 2.2rem;
        height: 2.2rem;
    }

    .domino-table-felt {
        margin: 0.25rem;
        padding: 0.25rem;
    }

    #player-hand-container {
        min-height: 72px;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    .table-chat-bar {
        padding-top: 0.25rem;
        padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
    }

    .animate-dialog {
        max-height: 88dvh !important;
        padding: 0.65rem !important;
    }
}

/* ── Profile skeleton overlay ── */
.view-profile-skeleton-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-warm-card, #1a1a1f);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

/* ── Skeleton loading ── */

@keyframes skeletonShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 800px 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
    border-radius: 0.5rem;
}

.skeleton-circle {
    border-radius: 9999px;
}

.skeleton-line {
    height: 0.65rem;
    border-radius: 0.3rem;
}

.skeleton-line-sm {
    height: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-line-lg {
    height: 0.8rem;
    border-radius: 0.4rem;
}

/* Room card skeleton */
.skeleton-room-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Friend card skeleton */
.skeleton-friend-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Moment/post skeleton */
.skeleton-moment-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
}

/* ── Load fallback (where a skeleton view ends) ── */
.load-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 1.6rem 1rem;
    text-align: center;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px dashed var(--border);
}

.load-fallback-icon {
    color: var(--text-2);
    opacity: 0.7;
}

.load-fallback-text {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 18rem;
}

.load-fallback-empty {
    padding: 1.1rem 1rem;
    background: transparent;
}

.load-fallback-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9999px;
    color: var(--gold);
    background: var(--gold-bg);
    border: 1px solid rgba(201, 169, 110, 0.42);
    transition: background 0.15s ease, transform 0.15s ease;
}

.load-fallback-retry:hover {
    background: rgba(201, 169, 110, 0.22);
}

.load-fallback-retry:active {
    transform: scale(0.96);
}

