/* Telegram Native Style - Clean & Minimal */
:root {
    --tg-theme-bg-color: #17212b;
    --tg-theme-secondary-bg-color: #232e3c;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #708499;
    --tg-theme-link-color: #6ab2f2;
    --tg-theme-button-color: #5288c1;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-destructive-color: #e53935;
    --tg-theme-success-color: #4caf50;
    --tg-theme-separator-color: #101921;
    --tg-theme-header-bg-color: #17212b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    touch-action: manipulation;
}

/* Screen Management */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* Header - Telegram Style */
.header {
    background: var(--tg-theme-header-bg-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--tg-theme-separator-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--tg-theme-link-color);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.header-back:hover {
    background: rgba(255,255,255,0.05);
}

.header-back svg {
    width: 24px;
    height: 24px;
}

.header-back,
.lang-btn,
.list-item,
.btn,
.call-btn,
.game-card,
.report-reason,
.mini-chat-send,
.ttt-cell,
.rps-choice {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
}

.header-subtitle {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    font-weight: 400;
}

/* Language Switcher */
.lang-switch {
    display: flex;
    background: var(--tg-theme-bg-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.lang-btn {
    padding: 6px 10px;
    border: none;
    background: none;
    color: var(--tg-theme-hint-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.lang-btn.active {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

/* Content Area */
.content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.content-padded {
    padding: 16px;
}

/* Section */
.section {
    background: var(--tg-theme-secondary-bg-color);
    margin: 8px 0;
}

.section:first-child {
    margin-top: 0;
}

.section-header {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* List Items - Telegram Style */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-bottom: 1px solid var(--tg-theme-separator-color);
    cursor: pointer;
    transition: background 0.15s;
}

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

.list-item:active {
    background: rgba(255,255,255,0.05);
}

.list-item-icon {
    width: 24px;
    height: 24px;
    color: var(--tg-theme-hint-color);
    flex-shrink: 0;
}

.list-item-icon.primary {
    color: var(--tg-theme-link-color);
}

.list-item-icon.destructive {
    color: var(--tg-theme-destructive-color);
}

.list-item-icon.success {
    color: var(--tg-theme-success-color);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 16px;
    color: var(--tg-theme-text-color);
}

.list-item-title .badge {
    margin-left: 8px;
    vertical-align: middle;
}

.list-item-subtitle {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

.list-item-value {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
}

.list-item-chevron {
    width: 20px;
    height: 20px;
    color: var(--tg-theme-hint-color);
    opacity: 0.5;
}

.list-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mini-action-btn {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--tg-theme-text-color);
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.mini-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}

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

.btn-primary {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.btn-secondary {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-destructive {
    background: var(--tg-theme-destructive-color);
    color: white;
}

.btn-text {
    background: none;
    color: var(--tg-theme-link-color);
    padding: 12px;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Avatar */
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--tg-theme-button-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-large {
    width: 100px;
    height: 100px;
}

.avatar svg {
    width: 32px;
    height: 32px;
    color: white;
}

.avatar-large svg {
    width: 48px;
    height: 48px;
}

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

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    gap: 48px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--tg-theme-link-color);
}

.stat-label {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-top: 4px;
}

/* Messenger shell */
.messenger-hero {
    margin: 12px 12px 6px;
    padding: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(106, 178, 242, 0.26), transparent 34%),
        linear-gradient(135deg, rgba(82, 136, 193, 0.24), rgba(76, 175, 80, 0.10)),
        var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 40px rgba(0,0,0,0.20);
}

.messenger-kicker {
    color: var(--tg-theme-link-color);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.messenger-title {
    font-size: 28px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.messenger-subtitle {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
    max-width: 26rem;
}

.messenger-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.messenger-pills span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--tg-theme-text-color);
    font-size: 12px;
}

.messenger-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messenger-card,
.messenger-profile-card,
.messenger-mode-card {
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 18px;
    padding: 16px;
}

.messenger-card.accent-card {
    background:
        linear-gradient(135deg, rgba(106, 178, 242, 0.18), rgba(76, 175, 80, 0.08)),
        var(--tg-theme-secondary-bg-color);
}

.messenger-card-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.messenger-card-text {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.messenger-mode-card {
    width: 100%;
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    gap: 14px;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
}

.messenger-mode-card:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.06);
}

.messenger-mode-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(106, 178, 242, 0.16);
    flex-shrink: 0;
}

.messenger-mode-title,
.messenger-mode-text {
    display: block;
}

.messenger-mode-title {
    font-size: 16px;
    font-weight: 650;
}

.messenger-mode-text {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
    margin-top: 2px;
}

.random-text-panel {
    min-height: calc(100vh - 92px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.random-text-status-card {
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(46, 166, 255, 0.18), rgba(52, 199, 89, 0.10));
}

.random-text-status-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin-bottom: 4px;
}

.random-text-status-text {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
    line-height: 1.35;
}

.random-text-messages {
    flex: 1;
    min-height: 280px;
    max-height: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    background: rgba(255,255,255,0.035);
}

.random-text-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.random-text-input-row {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    background: rgba(255,255,255,0.035);
}

.mini-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0 12px;
    font-size: 14px;
    background: rgba(255,255,255,0.06);
    color: var(--tg-theme-text-color);
    outline: none;
}

.mini-input::placeholder {
    color: var(--tg-theme-hint-color);
}

.direct-chat-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.direct-chat-tool-btn {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--tg-theme-text-color);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.direct-chat-tool-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#random-text-input,
#direct-chat-input {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(255,255,255,0.06);
    color: var(--tg-theme-text-color);
    outline: none;
}

#random-text-input::placeholder,
#direct-chat-input::placeholder {
    color: var(--tg-theme-hint-color);
}

#random-text-input:disabled,
#random-text-send-btn:disabled,
#direct-chat-input:disabled,
#direct-chat-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

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

.messenger-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 500;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border-radius: 22px;
    background: rgba(16, 25, 33, 0.92);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 16px 36px rgba(0,0,0,0.34);
    backdrop-filter: blur(16px);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.messenger-nav.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(120%);
}

.messenger-nav-item {
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--tg-theme-hint-color);
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.messenger-nav-item span:first-child {
    font-size: 17px;
    line-height: 1;
}

.messenger-nav-item.active {
    background: rgba(106, 178, 242, 0.16);
    color: var(--tg-theme-text-color);
}

#app.messenger-nav-visible .screen.active .content {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

/* Call Screen */
.call-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 16px;
    text-align: center;
}

.call-avatar {
    margin-bottom: 16px;
}

.call-status {
    font-size: 15px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 8px;
}

.call-timer {
    font-size: 17px;
    color: var(--tg-theme-text-color);
    font-variant-numeric: tabular-nums;
}

/* Audio Visualizer */
.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 48px;
    margin: 32px 0;
}

.visualizer-bar {
    width: 4px;
    background: var(--tg-theme-link-color);
    border-radius: 2px;
    min-height: 4px;
    transition: height 0.1s ease;
}

/* Call Controls */
.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    margin-top: auto;
}

.call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

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

.call-btn svg {
    width: 24px;
    height: 24px;
}

.call-btn-default {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.call-btn-end {
    background: var(--tg-theme-destructive-color);
    color: white;
}

.call-btn-accept {
    background: var(--tg-theme-success-color);
    color: white;
}

.call-btn.active {
    background: var(--tg-theme-link-color);
    color: white;
}

.call-btn.muted {
    background: var(--tg-theme-destructive-color);
    color: white;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 10px;
    margin: 16px;
}

.volume-control svg {
    width: 20px;
    height: 20px;
    color: var(--tg-theme-hint-color);
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--tg-theme-separator-color);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--tg-theme-link-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-value {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    min-width: 40px;
    text-align: right;
}

/* Audio unlock hint (autoplay restrictions on mobile WebViews) */
.audio-unlock {
    margin: 0 16px 16px;
    padding: 12px 14px;
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-separator-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.audio-unlock-text {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* Mini Chat (during call) */
.mini-chat {
    background: var(--tg-theme-secondary-bg-color);
    margin: 8px 0;
    border-top: 1px solid var(--tg-theme-separator-color);
}

.mini-chat-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--tg-theme-separator-color);
}

.mini-chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.mini-chat-messages {
    max-height: 240px;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-chat-msg {
    max-width: 82%;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
    white-space: pre-wrap;
}

.mini-chat-msg.message-actionable {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.mini-chat-msg.message-actionable:active {
    filter: brightness(1.06);
}

.message-action-menu {
    position: fixed;
    z-index: 1000;
    min-width: 168px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--tg-theme-separator-color);
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}

.message-action-menu[hidden] {
    display: none;
}

.message-action-title {
    padding: 4px 8px 8px;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.message-action-report {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.07);
    color: var(--tg-theme-text-color);
    text-align: left;
    font-size: 14px;
    font-weight: 600;
}

.message-action-report:active {
    background: rgba(255,255,255,0.12);
}

.mini-chat-msg.in {
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    color: var(--tg-theme-text-color);
}

.mini-chat-msg.out {
    align-self: flex-end;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.mini-chat-meta {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.mini-chat-label {
    font-weight: 600;
}

.mini-chat-caption {
    margin-top: 4px;
}

.mini-chat-media {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-chat-media img,
.mini-chat-media video {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

.mini-chat-media audio {
    width: 100%;
}

.mini-chat-media-loading {
    font-size: 12px;
    opacity: 0.85;
}

.mini-chat-media-btn {
    width: 100%;
}

.mini-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--tg-theme-separator-color);
}

.direct-chat-status {
    margin: 0 12px 10px;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--tg-theme-text-color);
    font-size: 13px;
    line-height: 1.35;
}

#mini-chat-input {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(255,255,255,0.06);
    color: var(--tg-theme-text-color);
    outline: none;
}

#mini-chat-input::placeholder {
    color: var(--tg-theme-hint-color);
}

.mini-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mini-chat-send svg {
    width: 20px;
    height: 20px;
}

/* Loading */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    padding: 32px;
}

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

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

.loader-text {
    font-size: 15px;
    color: var(--tg-theme-hint-color);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--tg-theme-hint-color);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 17px;
    color: var(--tg-theme-text-color);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 15px;
    color: var(--tg-theme-hint-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

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

.modal {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

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

.modal-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--tg-theme-separator-color);
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-content {
    padding: 16px;
}

.modal-actions {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.game-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
}

.game-card:active {
    background: rgba(255,255,255,0.05);
}

.game-card svg {
    width: 32px;
    height: 32px;
    color: var(--tg-theme-link-color);
}

.game-card-title {
    font-size: 14px;
    color: var(--tg-theme-text-color);
    text-align: center;
}

/* Game Board - Tic Tac Toe */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 280px;
    margin: 24px auto;
}

.ttt-cell {
    aspect-ratio: 1;
    background: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: 8px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--tg-theme-text-color);
}

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

.ttt-cell:not(:disabled):active {
    background: rgba(255,255,255,0.1);
}

.ttt-cell svg {
    width: 40px;
    height: 40px;
}

.ttt-cell .x-icon {
    color: var(--tg-theme-link-color);
}

.ttt-cell .o-icon {
    color: var(--tg-theme-destructive-color);
}

/* Game Status */
.game-status {
    text-align: center;
    padding: 16px;
    font-size: 16px;
    color: var(--tg-theme-hint-color);
}

.game-status.win {
    color: var(--tg-theme-success-color);
}

.game-status.lose {
    color: var(--tg-theme-destructive-color);
}

/* RPS Game */
.rps-choices {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px;
}

.rps-choice {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--tg-theme-secondary-bg-color);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rps-choice:active {
    transform: scale(0.95);
}

.rps-choice.selected {
    border-color: var(--tg-theme-link-color);
    background: rgba(82, 136, 193, 0.2);
}

.rps-choice svg {
    width: 36px;
    height: 36px;
    color: var(--tg-theme-text-color);
}

/* Roulette */
.roulette-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
}

.roulette-cylinder {
    display: flex;
    gap: 8px;
    margin: 24px 0;
}

.roulette-chamber {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tg-theme-secondary-bg-color);
    border: 2px solid var(--tg-theme-hint-color);
}

.roulette-chamber.current {
    border-color: var(--tg-theme-link-color);
}

.roulette-chamber.fired {
    background: var(--tg-theme-destructive-color);
    border-color: var(--tg-theme-destructive-color);
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.remote-video {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.local-video {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 100px;
    height: 75px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--tg-theme-bg-color);
}

/* Textarea */
textarea {
    width: 100%;
    padding: 12px;
    background: var(--tg-theme-bg-color);
    border: 1px solid var(--tg-theme-separator-color);
    border-radius: 10px;
    color: var(--tg-theme-text-color);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    outline: none;
    border-color: var(--tg-theme-link-color);
}

textarea::placeholder {
    color: var(--tg-theme-hint-color);
}

/* Hint Text */
.hint {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    padding: 8px 16px;
}

/* Divider */
.divider {
    height: 8px;
    background: var(--tg-theme-bg-color);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--tg-theme-link-color);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
}

.badge-success {
    background: var(--tg-theme-success-color);
}

.badge-destructive {
    background: var(--tg-theme-destructive-color);
}

/* Responsive */
@media (max-width: 380px) {
    .call-controls {
        gap: 12px;
    }

    .call-btn {
        width: 48px;
        height: 48px;
    }

    .call-btn svg {
        width: 20px;
        height: 20px;
    }

    .games-grid {
        gap: 8px;
        padding: 12px;
    }

    .game-card {
        padding: 16px;
    }
}
