@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
html { touch-action: manipulation; }
body { touch-action: pan-x pan-y; }

:root {
  --bg: #0c0a09;
  --bg2: #1c1917;
  --card: #292524;
  --accent: #d4a574;
  --accent2: rgba(212,165,116,0.08);
  --text: #fafaf9;
  --text2: #a8a29e;
  --border: rgba(212,165,116,0.1);
  --success: #86efac;
  --warning: #fcd34d;
}

::selection { background: rgba(212,165,116,0.3); }

html { background: #0c0a09; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}
body.dark-bg { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(212,165,116,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,165,116,0.35); }

/* PORTAL */
.portal-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(160deg, #0c0a09 0%, #1c1917 50%, #292524 100%); }
.portal-card { background: var(--card); border-radius: 20px; padding: 40px 30px; text-align: center; max-width: 380px; width: 100%; border: 1px solid var(--border); border-top: 2px solid var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.logo { font-size: 64px; margin-bottom: 16px; }
.portal-card h1 { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; margin-bottom: 12px; letter-spacing: 0.02em; color: var(--text); }
.portal-card p { color: var(--text2); line-height: 1.6; margin-bottom: 28px; }
.hint { color: var(--text2); font-size: 14px; margin-bottom: 12px; }
.steps { background: var(--bg2); border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: left; border: 1px solid var(--border); }
.step { padding: 6px 0; color: var(--text); font-size: 14px; }
.icon { font-size: 18px; }

/* BUTTONS */
.btn { display: block; width: 100%; padding: 14px 20px; border-radius: 100px; border: none; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #0c0a09; margin-bottom: 12px; }
.btn-primary:hover { box-shadow: 0 0 20px rgba(212,165,116,0.2); }
.btn-secondary { background: rgba(212,165,116,0.1); color: var(--accent); border: 1px solid rgba(212,165,116,0.2); }
.btn-secondary:hover { box-shadow: 0 0 20px rgba(212,165,116,0.15); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); margin-top: 12px; }
.btn-large { font-size: 18px; padding: 16px; }
.btn-fab { border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.install-btn-wrap { margin-bottom: 16px; }

/* ESTABLISHMENT BAR */
.establishment-bar { text-align: center; padding: 6px 16px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); background: var(--bg); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; flex-shrink: 0; font-family: 'DM Sans', sans-serif; }

/* PWA INSTALL BANNER */
.pwa-install-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pwa-install-text { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.pwa-install-icon { font-size: 20px; flex-shrink: 0; }
.pwa-install-btn { background: var(--accent); color: var(--bg); border: none; padding: 7px 16px; border-radius: 100px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.pwa-install-close { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; padding: 0 4px; flex-shrink: 0; }

/* HEADER */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 8px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.header-center { display: flex; align-items: center; gap: 8px; font-weight: 600; flex: 1; min-width: 0; }
.header-center span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Game menu dropdown */
.game-menu-wrap { position: relative; }
.game-menu-btn { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 5px 9px; font-size: 18px; cursor: pointer; line-height: 1; color: var(--text); }
.game-menu-btn:hover { border-color: var(--accent); }
.game-menu-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--border); border-radius: 14px; min-width: 190px; z-index: 200; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.game-menu-dropdown.open { display: block; }
.game-menu-title { padding: 10px 14px 6px; font-size: 12px; font-weight: 700; color: var(--text2); letter-spacing: 0.5px; text-transform: uppercase; }
.game-menu-item { display: block; width: 100%; padding: 12px 14px; background: none; border: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer; transition: background 0.15s; }
.game-menu-item:hover { background: var(--bg2); }
.game-menu-divider { height: 1px; background: var(--border); margin: 4px 10px; }
.game-menu-challenge { color: var(--gold) !important; font-weight: 600; }
.game-menu-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; user-select: none; }
.game-menu-toggle input { display: none; }
.game-toggle-slider { width: 36px; height: 20px; background: var(--border); border-radius: 10px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.game-toggle-slider::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: var(--text2); border-radius: 50%; transition: all 0.2s; }
.game-menu-toggle input:checked + .game-toggle-slider { background: var(--accent); }
.game-menu-toggle input:checked + .game-toggle-slider::after { left: 18px; background: #0c0a09; }
.game-toggle-label { font-size: 13px; color: var(--text2); }
.challenge-popup { max-height: 70vh; overflow-y: auto; }
.challenge-game-select { display: flex; gap: 8px; justify-content: center; padding: 8px 0 12px; flex-wrap: wrap; }
.challenge-game-btn { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--border); background: var(--card); font-size: 22px; cursor: pointer; transition: all 0.2s; }
.challenge-game-btn:hover, .challenge-game-btn.active { border-color: var(--gold); background: rgba(212,165,116,0.1); transform: scale(1.08); }
.challenge-tables-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.challenge-table-btn { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 15px; cursor: pointer; transition: all 0.15s; }
.challenge-table-btn:hover { border-color: var(--gold); background: rgba(212,165,116,0.06); }
.challenge-table-btn .challenge-send-icon { font-size: 18px; opacity: 0.6; }

/* Game invite chat bubble */
.msg-game-invite { background: rgba(212,165,116,0.08) !important; border: 1px solid rgba(212,165,116,0.2) !important; }
.msg-join-btn { display: block; width: 100%; margin-top: 8px; padding: 9px; background: var(--accent); color: #0c0a09; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.logo-icon { font-size: 24px; }
.back-btn { background: var(--card); border: 1px solid var(--border); color: var(--text); width: 38px; height: 38px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s, transform 0.1s; }
.back-btn:hover { background: rgba(212,165,116,0.1); }
.back-btn:active { transform: scale(0.93); }
.feedback-btn { background: transparent; border: 1px solid var(--border); color: var(--text2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.feedback-btn:hover { border-color: var(--success); color: var(--success); }

/* VENUE RULES MODAL */
.rules-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.rules-modal { background: var(--bg2); border-radius: 20px; width: 100%; max-width: 480px; max-height: 80vh; border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.rules-modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 17px; text-align: center; }
.rules-text { padding: 16px 20px; font-size: 15px; line-height: 1.6; color: var(--text); overflow-y: auto; flex: 1; white-space: pre-wrap; }
.rules-scroll-hint { text-align: center; font-size: 13px; color: var(--accent); padding: 8px 20px 0; animation: rulesHintPulse 1.5s ease-in-out infinite; }
@keyframes rulesHintPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }
.rules-checkbox-label { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text2); cursor: pointer; }
.rules-checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.rules-accept-btn { display: block; width: calc(100% - 40px); margin: 0 20px 16px; background: var(--accent); color: #0c0a09; border: none; padding: 14px; border-radius: 100px; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.rules-accept-btn:disabled { opacity: 0.4; cursor: default; }

/* FEEDBACK MODAL */
.feedback-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 500; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.feedback-modal { background: var(--bg2); border-radius: 20px; width: 100%; max-width: 480px; border: 1px solid var(--border); overflow: hidden; }
.feedback-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.feedback-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; }
.feedback-type-row { display: flex; gap: 8px; padding: 14px 16px 0; }
.feedback-type-btn { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text2); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.feedback-type-btn.active { background: rgba(212,165,116,0.1); color: var(--accent); border-color: rgba(212,165,116,0.3); }
.feedback-textarea { width: 100%; margin: 12px 16px 0; width: calc(100% - 32px); background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 15px; resize: none; height: 110px; font-family: inherit; }
.feedback-textarea:focus { outline: none; border-color: var(--accent); }
.feedback-submit { display: block; width: calc(100% - 32px); margin: 10px 16px 16px; background: var(--accent); color: #0c0a09; border: none; padding: 13px; border-radius: 100px; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, box-shadow 0.2s; }
.feedback-submit:hover { box-shadow: 0 0 20px rgba(212,165,116,0.2); }
.feedback-submit:disabled { opacity: 0.6; cursor: default; }
.cart-btn { background: rgba(212,165,116,0.1); border: none; color: var(--text); width: 42px; height: 42px; border-radius: 14px; font-size: 16px; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.1s; }
.cart-btn:hover { background: rgba(212,165,116,0.2); }
.cart-btn:active { transform: scale(0.93); }
.cart-btn.has-items { background: var(--accent); color: #0c0a09; }
.cart-btn.has-items:hover { background: #c9965f; }
.cart-badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: #0c0a09; border-radius: 10px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); transition: transform 0.2s; }
.cart-badge:empty, .cart-badge[data-zero] { display: none; }

/* CATEGORIES */
.categories { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; background: var(--bg2); border-bottom: 1px solid var(--border); }
.categories::-webkit-scrollbar { display: none; }
.cat-btn { flex-shrink: 0; padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 14px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.cat-btn.active { background: var(--accent); color: #0c0a09; border-color: var(--accent); }

/* PAGE LAYOUT */
.page-content { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* MENU */
.menu-list { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px; }
.menu-section { margin-bottom: 24px; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 12px; color: var(--accent); }
.items-grid { display: flex; flex-direction: column; gap: 10px; }
.menu-item { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border); cursor: pointer; transition: border-color 0.2s; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.menu-item:active { border-color: var(--accent); }
.item-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.item-desc { color: var(--text2); font-size: 13px; margin-bottom: 6px; }
.item-price { font-family: 'Cormorant Garamond', serif; color: var(--accent); font-weight: 600; font-size: 18px; }
.add-btn { background: var(--accent); color: #0c0a09; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; flex-shrink: 0; transition: box-shadow 0.2s; }
.add-btn:hover { box-shadow: 0 0 16px rgba(212,165,116,0.25); }

/* CART FAB */
.cart-fab { position: fixed; bottom: 20px; left: 16px; right: 16px; z-index: 200; }

/* SCAN PAGE */
.scan-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 0px); padding: 40px 20px; text-align: center; }
.scan-icon { font-size: 80px; margin-bottom: 24px; }
.scan-page h2 { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 600; margin-bottom: 12px; letter-spacing: 0.02em; }
.scan-page p { color: var(--text2); margin-bottom: 32px; }
.manual-table { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 12px; }
.select { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 16px; }
.select:focus { outline: none; border-color: var(--accent); }

/* CART PAGE */
.cart-page { padding: 16px; padding-bottom: 220px; display: flex; flex-direction: column; gap: 12px; flex: 1; overflow-y: auto; min-height: 0; }
.cart-item { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.cart-item-name { font-weight: 600; margin-bottom: 4px; }
.cart-item-price { color: var(--text2); font-size: 14px; }
.cart-item-controls { display: flex; align-items: center; gap: 12px; }
.qty-btn { background: var(--bg2); border: 1px solid rgba(212,165,116,0.15); color: var(--text); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; transition: border-color 0.2s; }
.qty-btn:active { border-color: var(--accent); background: rgba(212,165,116,0.1); }
.qty { font-weight: 700; font-size: 16px; min-width: 20px; text-align: center; }
.cart-comment textarea { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 15px; resize: none; font-family: inherit; }
.cart-comment textarea:focus { outline: none; border-color: var(--accent); }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; padding: 0 4px; }
.cart-total strong { font-family: 'Cormorant Garamond', serif; color: var(--accent); font-size: 20px; }
.empty-cart { text-align: center; color: var(--text2); padding: 40px; font-size: 16px; }

/* STATUS PAGE */
.status-page { padding: 20px 16px; }
.status-card { background: var(--card); border-radius: 20px; padding: 30px; text-align: center; margin-bottom: 16px; border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.status-icon { font-size: 56px; margin-bottom: 12px; }
.status-text { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.status-new .status-icon, .status-new .status-text { color: var(--text2); }
.status-accepted .status-text { color: var(--success); }
.status-preparing .status-text { color: var(--warning); }
.status-ready .status-text { color: var(--success); }
.order-meta { color: var(--text2); font-size: 14px; margin-top: 8px; }
.ready-alert { background: var(--success); color: #0c0a09; border-radius: 12px; padding: 12px; margin-top: 16px; font-weight: 600; }
.order-items-list { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.order-item-row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 15px; }
.order-item-row:last-child { border-bottom: none; }
.order-total-row { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 17px; background: var(--bg2); }
.order-total-row strong { font-family: 'Cormorant Garamond', serif; color: var(--accent); }

/* TABLE / CHAT PAGE */
.menu-link-btn { background: rgba(212,165,116,0.1); border: none; color: var(--accent); padding: 8px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chat-wrap { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-messages { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding: 12px 12px 200px; }

/* System message */
.chat-system-msg { text-align: center; color: var(--text2); font-size: 12px; padding: 6px 14px; background: var(--bg2); border-radius: 20px; align-self: center; margin: 4px 0; }

/* Message row */
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-out { flex-direction: row-reverse; }
.msg-in  { flex-direction: row; }

/* Avatar */
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bg2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; margin-bottom: 2px; }
.msg-avatar-logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; margin-bottom: 2px; }

/* Bubble */
.msg-bubble { max-width: 78%; padding: 9px 13px 6px; border-radius: 18px; position: relative; word-break: break-word; }
.msg-out .msg-bubble { background: rgba(212,165,116,0.12); color: var(--text); border: 1px solid rgba(212,165,116,0.15); border-bottom-right-radius: 4px; }
.msg-in  .msg-bubble { background: var(--card); color: var(--text); border-bottom-left-radius: 4px; border: 1px solid var(--border); }

/* Time */
.msg-time { font-size: 10px; opacity: 0.55; margin-top: 4px; text-align: right; }

/* Repeat button inside bubble */
.msg-bubble-row { display: flex; align-items: center; gap: 8px; }
.msg-repeat-btn { background: rgba(212,165,116,0.1); border: 1px solid rgba(212,165,116,0.25); border-radius: 100px; padding: 4px 10px; font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; gap: 4px; transition: all 0.25s ease; color: var(--accent); letter-spacing: 0.02em; }
.msg-repeat-btn:hover { background: rgba(212,165,116,0.2); border-color: rgba(212,165,116,0.4); }
.msg-repeat-btn:active { transform: scale(0.93); }


/* Repeat popup */
.repeat-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; z-index: 200; }
.repeat-popup { background: var(--card); border-radius: 20px 20px 0 0; padding: 24px 20px; width: 100%; max-width: 480px; border: 1px solid var(--border); border-bottom: none; }
.repeat-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; margin-bottom: 14px; }
.repeat-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.repeat-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; padding: 10px 14px; background: var(--bg2); border-radius: 12px; }
.repeat-item-name { flex: 1; }
.repeat-qty { display: flex; align-items: center; gap: 10px; }
.repeat-qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.repeat-qty-val { font-size: 16px; font-weight: 700; min-width: 20px; text-align: center; }
.repeat-actions { display: flex; gap: 10px; }
.repeat-btn-cancel { flex: 1; padding: 13px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 15px; cursor: pointer; }
.repeat-btn-confirm { flex: 2; padding: 13px; border-radius: 100px; border: none; background: var(--accent); color: #0c0a09; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Order bubble */
.msg-order { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-bottom-right-radius: 4px; min-width: 200px; }
.msg-order-title { font-size: 12px; font-weight: 600; opacity: 0.6; margin-bottom: 6px; }
.msg-order-items { font-size: 14px; margin-bottom: 8px; line-height: 1.5; }
.msg-order-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 7px; margin-top: 2px; }
.msg-order-total { font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--accent); font-size: 15px; }
.msg-order-status { font-size: 12px; color: var(--success); }

/* Wishlist bubble */
.msg-wishlist { background: rgba(212,165,116,0.06) !important; color: var(--text) !important; border: 1px solid rgba(212,165,116,0.15) !important; border-bottom-right-radius: 4px; min-width: 210px; }
.msg-wishlist-title { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.msg-wishlist-rows { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.msg-wishlist-row { display: flex; justify-content: space-between; font-size: 13px; }
.msg-wishlist-row span:last-child { opacity: 0.65; }
.msg-wishlist-total { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 14px; color: var(--accent); border-top: 1px solid rgba(212,165,116,0.15); padding-top: 7px; }

/* BOTTOM BAR */
.guest-msg-row { display: flex; gap: 8px; align-items: center; }
.guest-msg-input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.guest-msg-input:focus { border-color: var(--accent); }
.guest-msg-input::placeholder { color: var(--text2); }
.guest-msg-send { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent); color: #0c0a09; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.2s, transform 0.1s; }
.guest-msg-send:active { transform: scale(0.92); }
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg2); border-top: 1px solid var(--border); z-index: 100; box-sizing: border-box; }
.bottom-row-top { display: flex; gap: 8px; }
.bottom-btn-wrap { flex: 1; position: relative; }
.bottom-btn-wrap-full { flex: none; }
.bottom-btn { width: 100%; padding: 14px 12px; border: none; border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.1s; box-sizing: border-box; height: 48px; display: flex; align-items: center; justify-content: center; }
.bottom-btn:active { transform: scale(0.97); }
.bottom-btn-menu { background: var(--accent2); color: var(--text); }
.bottom-btn-call { background: var(--accent); color: #0c0a09; }
.bottom-btn-quick { background: var(--accent2); color: var(--text); }
.bottom-row-quick { display: flex; gap: 8px; align-items: stretch; }
.bottom-row-quick .bottom-btn-bill { background: var(--accent); color: #0c0a09; }

/* Чек */
.msg-bill { min-width: 240px; max-width: 320px; background: #fff; color: #1a1a1a; padding: 16px 18px; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.18); font-family: 'Courier New', ui-monospace, monospace; }
.bill-header { text-align: center; padding-bottom: 10px; border-bottom: 1px dashed #999; margin-bottom: 10px; }
.bill-logo { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 6px; display: block; border-radius: 8px; background: #fff; }
.bill-venue { font-weight: 800; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; color: #1a1a1a; }
.bill-meta { font-size: 11px; color: #666; margin-top: 4px; }
.bill-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; text-align: center; color: #1a1a1a; letter-spacing: .5px; }
.bill-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; margin-bottom: 10px; }
.bill-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; font-size: 13px; align-items: baseline; }
.bill-name { color: #1a1a1a; word-break: break-word; }
.bill-qty { color: #666; white-space: nowrap; font-size: 12px; }
.bill-sum { color: #1a1a1a; white-space: nowrap; font-weight: 600; }
.bill-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 16px; padding-top: 4px; color: #1a1a1a; }
.bill-total span:last-child { color: #1a1a1a; }
.bill-footer { text-align: center; font-size: 11px; color: #888; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #999; font-style: italic; }

/* ─── Обучающий тур ─────────────────────────── */
#tour-overlay { position: fixed; inset: 0; z-index: 99998; pointer-events: auto; animation: tourFade 0.25s ease; }
@keyframes tourFade { from { opacity: 0 } to { opacity: 1 } }
#tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.72); transition: all 0.3s cubic-bezier(.4,.0,.2,1); pointer-events: none; outline: 2px solid var(--accent, #d4a574); outline-offset: 2px; animation: tourPulse 1.8s ease-in-out infinite; }
@keyframes tourPulse { 0%,100% { outline-color: rgba(212,165,116,0.9) } 50% { outline-color: rgba(212,165,116,0.35) } }
#tour-tip { position: fixed; max-width: 300px; min-width: 240px; background: #1f2937; color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 32px rgba(0,0,0,.45); font-family: system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.45; transition: all 0.3s cubic-bezier(.4,.0,.2,1); }
#tour-tip::before { content: ''; position: absolute; left: var(--arrow-x, 50%); transform: translateX(-50%); width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; }
#tour-tip[data-arrow="up"]::before { top: -9px; border-bottom: 9px solid #1f2937; }
#tour-tip[data-arrow="down"]::before { bottom: -9px; border-top: 9px solid #1f2937; }
#tour-step-num { font-size: 11px; opacity: 0.6; letter-spacing: 1px; margin-bottom: 4px; }
#tour-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--accent, #d4a574); }
#tour-text { font-size: 13px; opacity: 0.9; margin-bottom: 12px; }
#tour-actions { display: flex; align-items: center; gap: 8px; }
#tour-actions button { background: transparent; color: #cbd5e1; border: 0; padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 8px; font-family: inherit; }
#tour-actions #tour-skip { color: #94a3b8; }
#tour-actions #tour-next { background: var(--accent, #d4a574); color: #1a1a1a; font-weight: 700; padding: 9px 16px; }
#tour-actions #tour-next:active { transform: scale(0.96); }
.bottom-dropdown { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: none; flex-direction: column; z-index: 300; box-shadow: 0 -4px 20px rgba(0,0,0,0.4); }
.bottom-dropdown.open { display: flex; }
.bottom-dropdown button { background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: 13px 16px; font-size: 15px; text-align: left; cursor: pointer; transition: background 0.15s; }
.bottom-dropdown button:last-child { border-bottom: none; }
.bottom-dropdown button:active { background: var(--bg2); }


/* Split Bill Modal */
.split-bill-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.75); display: flex; align-items: flex-end; justify-content: center; padding: 0 0 0; }
.split-bill-modal { background: var(--bg2); border-radius: 20px 20px 0 0; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; padding: 0 0 env(safe-area-inset-bottom, 0px); }
.split-bill-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; font-size: 17px; font-weight: 600; color: var(--text); }
.split-bill-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 4px; }
.split-bill-tabs { display: flex; gap: 0; padding: 0 16px 12px; }
.split-tab { flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text2); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.split-tab:first-child { border-radius: 10px 0 0 10px; }
.split-tab:last-child { border-radius: 0 10px 10px 0; }
.split-tab.active { background: var(--accent); color: #0c0a09; border-color: var(--accent); }
.split-bill-body { padding: 0 20px 16px; }
.split-even-total { font-size: 15px; color: var(--text2); margin-bottom: 16px; text-align: center; }
.split-even-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.split-even-row span { font-size: 15px; color: var(--text); }
.split-counter { display: flex; align-items: center; gap: 14px; }
.split-counter-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 20px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.split-counter-btn:active { background: var(--accent2); }
#splitPeopleCount { font-size: 20px; font-weight: 700; color: var(--text); min-width: 24px; text-align: center; }
.split-even-result { text-align: center; padding: 20px 0 8px; font-size: 18px; color: var(--text); }
.split-even-result strong { color: var(--accent); font-size: 24px; }
.split-personal-list { display: flex; flex-direction: column; gap: 12px; }
.split-person-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.split-person-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.split-person-item { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); padding: 3px 0; }
.split-person-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; color: var(--accent); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.split-bill-confirm { display: block; width: calc(100% - 40px); margin: 8px 20px 0; padding: 14px; background: var(--accent); color: #0c0a09; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.split-bill-confirm:active { opacity: 0.8; }
.split-bill-back { display: block; width: calc(100% - 40px); margin: 8px 20px 20px; padding: 14px; background: none; color: var(--text2); border: 1px solid var(--border); border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer; text-align: center; }
.split-bill-back:active { background: var(--bg); }

/* Tips button */
.tips-btn { display: block; width: 100%; padding: 11px 14px; border: none; border-radius: 10px; background: linear-gradient(135deg, #d4a574, #c4956a); color: #1a1a1a; font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; transition: opacity 0.2s; }
.tips-btn:active { opacity: 0.8; }

/* Payment choice buttons */
.pay-choice-btn { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; text-align: left; }
.pay-choice-btn:active { background: var(--accent2); }

/* TOAST */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(212,165,116,0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--text); border: 1px solid rgba(212,165,116,0.2); border-radius: 20px; padding: 12px 20px; font-size: 15px; opacity: 0; transition: all 0.3s; z-index: 500; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ITEM QTY CONTROLS ON CARD */
.item-qty-ctrl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn-sm { background: var(--bg2); border: 1px solid rgba(212,165,116,0.15); color: var(--text); width: 28px; height: 28px; border-radius: 8px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s; }
.qty-btn-sm:active { border-color: var(--accent); background: rgba(212,165,116,0.1); }
.qty-count { font-weight: 700; font-size: 15px; min-width: 18px; text-align: center; color: var(--accent); }

/* UTILS */
.dark-bg { background: var(--bg); }
.loading { text-align: center; color: var(--text2); padding: 40px; }

/* LOGO */
.logo-img { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

/* LANG SWITCHER */
.lang-btn { background: transparent; border: 1px solid var(--border); color: var(--text2); padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; cursor: pointer; letter-spacing: 0.5px; transition: border-color 0.2s; }
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

/* PROFILE */
.profile-btn { background: transparent; border: 1px solid var(--border); color: var(--text2); width: 32px; height: 32px; border-radius: 10px; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.profile-btn:hover { border-color: var(--accent); color: var(--accent); }
.profile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.profile-modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 420px; max-height: 85vh; display: flex; flex-direction: column; border: 1px solid var(--border); overflow: hidden; }
.profile-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 17px; font-weight: 700; }
.profile-close { background: none; border: none; color: var(--text2); font-size: 22px; cursor: pointer; }
.profile-body { flex: 1; overflow-y: auto; }
.profile-info { padding: 20px; border-bottom: 1px solid var(--border); }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.profile-label { font-size: 13px; color: var(--text2); }
.profile-value { font-size: 14px; font-weight: 600; }
.profile-orders-title { padding: 16px 20px 8px; font-size: 14px; font-weight: 700; color: var(--text2); }
.profile-order { margin: 0 16px 10px; padding: 14px; background: var(--bg2); border-radius: 14px; border: 1px solid var(--border); }
.profile-order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.profile-order-date { font-size: 12px; color: var(--text2); }
.profile-order-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.profile-order-item { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; color: var(--text2); }
.profile-order-total { display: flex; justify-content: space-between; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.profile-logout { margin: 16px; }

/* SLIDE UP ANIMATION */
@keyframes slideUpIn {
  from { transform: translateY(100vh); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.slide-up { animation: slideUpIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* --- GAME: TIC-TAC-TOE --- */
.call-game { background: linear-gradient(135deg, #8b5e3c, #d4a574) !important; color: #0c0a09 !important; }

/* Invite */
.game-invite-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(212,165,116,0.06); border-top: 1px solid rgba(212,165,116,0.15); border-bottom: 1px solid rgba(212,165,116,0.15); font-size: 14px; }
.game-invite-bar span { flex: 1; }
.game-invite-join { background: var(--accent); color: #0c0a09; border: none; border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.game-invite-dismiss { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; padding: 0 4px; }

/* Overlay */
.game-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: flex-end; justify-content: center; z-index: 300; }
.game-modal { background: var(--card); border-radius: 24px 24px 0 0; padding: 20px; width: 100%; max-width: min(480px, 100vw); border: 1px solid rgba(212,165,116,0.15); border-bottom: none; max-height: 100dvh; overflow-y: auto; }
.game-modal-header { display: flex; justify-content: space-between; align-items: center; font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.game-modal-header button { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; }

/* Players */
.game-players { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.game-player { font-size: 15px; font-weight: 600; padding: 6px 14px; border-radius: 20px; background: var(--bg2); border: 2px solid transparent; }
.game-player.me { border-color: var(--accent); color: var(--accent); }
.game-vs { color: var(--text2); font-size: 13px; }

/* Status */
.game-status { text-align: center; font-size: 17px; font-weight: 700; margin-bottom: 14px; min-height: 26px; }
.game-status.my-turn { color: var(--accent); }
.game-status.their-turn { color: var(--text2); }
.game-status.finished { color: var(--success); }
.game-status.waiting { color: var(--text2); }

/* Board */
.game-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.game-cell { aspect-ratio: 1; font-size: 42px; font-weight: 900; border: 2px solid var(--border); border-radius: 14px; background: var(--bg2); color: var(--text); cursor: default; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.game-cell.x { color: var(--accent); border-color: rgba(212,165,116,0.3); background: rgba(212,165,116,0.06); }
.game-cell.o { color: var(--success); border-color: rgba(134,239,172,0.3); background: rgba(134,239,172,0.06); }
.game-cell.active { cursor: pointer; border-color: rgba(212,165,116,0.4); }
.game-cell.active:hover { background: rgba(212,165,116,0.1); border-color: var(--accent); transform: scale(1.05); }

/* Buttons */
.game-actions { display: flex; gap: 10px; }
.game-btn-rematch { flex: 2; padding: 14px; border-radius: 100px; border: none; background: var(--accent); color: #0c0a09; font-size: 15px; font-weight: 700; cursor: pointer; }
.game-btn-leave { flex: 1; padding: 14px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 15px; cursor: pointer; }

/* --- RPS --- */
.rps-area { padding: 4px 0; }
.rps-score { display:flex; justify-content:space-between; align-items:center; font-size:14px; font-weight:600; margin-bottom:4px; }
.rps-nums { font-family:'Cormorant Garamond', serif; font-size:22px; font-weight:900; color:var(--accent); }
.rps-round { text-align:center; font-size:12px; color:var(--text2); margin-bottom:12px; }
.rps-choices { display:flex; gap:10px; justify-content:center; margin:8px 0; }
.rps-btn { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 8px; background:var(--bg2); border:2px solid var(--border); border-radius:16px; color:var(--text); font-size:30px; cursor:pointer; transition:all 0.15s; }
.rps-btn span { font-size:12px; font-weight:600; color:var(--text2); }
.rps-btn:hover { border-color:var(--accent); background:rgba(212,165,116,0.08); }
.rps-btn:active { transform:scale(0.95); }
.rps-chosen { text-align:center; font-size:28px; padding:20px; color:var(--text2); }
.rps-reveal { display:flex; justify-content:space-around; align-items:center; font-size:46px; padding:12px 0; }
.rps-res-label { font-size:15px; font-weight:700; text-align:center; }

/* --- Battleship --- */
.bs-wrap { display:flex; flex-direction:column; gap:14px; }
.bs-section { display:flex; flex-direction:column; align-items:center; gap:6px; }
.bs-label { font-size:13px; font-weight:700; color:var(--text2); letter-spacing:0.5px; }
.bs-grid { display:grid; grid-template-columns:repeat(8,1fr); gap:2px; width:100%; max-width:min(296px, 45vw); }
.bs-cell { aspect-ratio:1; border-radius:5px; border:1px solid var(--border); background:var(--bg2); cursor:default; transition:all 0.1s; }
.bs-cell.bs-ship { background:#3d2b1a; border-color:#6b4c30; }
.bs-cell.bs-hit { background:rgba(212,165,116,0.5); border-color:var(--accent); }
.bs-cell.bs-miss { background:rgba(255,255,255,0.05); border-color:rgba(212,165,116,0.1); }
.bs-cell.bs-sunk { background:var(--accent); border-color:#c9965f; }
.bs-cell[onclick] { cursor:pointer; }
.bs-cell[onclick]:hover { background:rgba(212,165,116,0.2); border-color:var(--accent); transform:scale(1.1); }

/* --- Alias --- */
.alias-board { padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.alias-timer { font-family: 'Cormorant Garamond', serif; font-size: 60px; font-weight: 900; color: var(--success); line-height: 1; }
.alias-timer.danger { color: var(--accent); animation: alias-pulse 0.5s infinite alternate; }
@keyframes alias-pulse { from { opacity: 1; } to { opacity: 0.4; } }
.alias-word { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 900; text-align: center; color: var(--text); background: var(--bg2); border: 2px solid rgba(212,165,116,0.3); border-radius: 16px; padding: 20px 16px; width: 100%; }
.alias-guess-prompt { font-size: 20px; font-weight: 700; color: var(--text2); text-align: center; padding: 20px 0; }
.alias-hint { font-size: 12px; color: var(--text2); text-align: center; }
.alias-score-row { display: flex; align-items: center; gap: 16px; font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 900; }
.alias-score-row .alias-vs { font-size: 16px; color: var(--text2); font-weight: 400; font-family: 'DM Sans', sans-serif; }
.alias-ready-msg { text-align: center; color: var(--text2); line-height: 1.6; font-size: 15px; padding: 8px 0; }
.alias-round-results { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.alias-result-group { display: flex; flex-direction: column; gap: 6px; }
.alias-result-label { font-size: 13px; font-weight: 700; color: var(--text2); }
.alias-word-tag { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 14px; margin: 2px; }
.alias-word-ok { background: rgba(134,239,172,0.12); color: var(--success); border: 1px solid rgba(134,239,172,0.25); }
.alias-word-skip { background: rgba(255,255,255,0.04); color: var(--text2); border: 1px solid var(--border); }
.alias-total-score { text-align: center; font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; padding-top: 4px; }
.alias-final-score { display: flex; align-items: center; gap: 20px; font-family: 'Cormorant Garamond', serif; font-size: 60px; font-weight: 900; padding: 16px 0; }
.alias-final-score .alias-vs { font-size: 20px; color: var(--text2); font-weight: 400; font-family: 'DM Sans', sans-serif; }
.alias-btn-guess { flex: 2; padding: 16px; border-radius: 100px; border: none; background: var(--success); color: #0c0a09; font-size: 16px; font-weight: 700; cursor: pointer; }
.alias-btn-guess:active { opacity: 0.8; transform: scale(0.97); }
.alias-btn-skip { flex: 1; padding: 16px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 15px; cursor: pointer; }

/* --- Draw a Word --- */
.game-overlay--draw { align-items: stretch; }
.game-overlay--draw .game-modal { border-radius: 16px 16px 0 0; height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
.game-overlay--draw #gameBoard { flex: 1; overflow: hidden; min-height: 0; }
.draw-board { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.draw-info-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.draw-word { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 900; color: var(--accent); flex: 1; text-align: center; }
.draw-guess-label { font-size: 15px; color: var(--text2); flex: 1; text-align: center; }
.draw-score-sm { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 900; min-width: 40px; text-align: right; }
.draw-canvas-wrap { flex: 1; background: #1c1917; border-radius: 12px; overflow: hidden; min-height: 0; border: 1px solid var(--border); }
.draw-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.draw-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draw-colors { display: flex; gap: 6px; }
.draw-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; flex-shrink: 0; transition: transform 0.15s; }
.draw-color.active { border-color: var(--accent); transform: scale(1.25); }
.draw-widths { display: flex; gap: 4px; }
.draw-width { background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1; }
.draw-width.active { border-color: var(--accent); color: var(--accent); }
.draw-clear-btn { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text2); padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.draw-input-wrap { display: flex; gap: 8px; }
.draw-input { flex: 1; background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: 12px; font-size: 16px; font-family: inherit; }
.draw-input:focus { outline: none; border-color: var(--accent); }
.draw-guess-btn { background: var(--accent); color: #0c0a09; border: none; padding: 12px 20px; border-radius: 12px; font-size: 20px; font-weight: 700; cursor: pointer; }

/* CALL BUTTONS (cart page) */
.call-buttons { position: fixed; bottom: 0; left: 0; right: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--bg); z-index: 100; }
.call-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.call-btn:active { transform: scale(0.97); }
.call-barman { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.call-barman:hover { background: var(--bg2); }
.call-waiter { background: var(--success); color: #0c0a09; border: none; }
.call-waiter:hover { background: #6de09a; }
.call-waiter:disabled { opacity: 0.5; cursor: not-allowed; }

/* SPLIT BILL */
.call-split { background: rgba(212,165,116,0.08); color: var(--accent); border: 1px solid rgba(212,165,116,0.15); }
.call-split:hover { background: rgba(212,165,116,0.14); }
.split-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 600; display: flex; align-items: flex-end; justify-content: center; }
.split-modal { background: var(--bg2); border-radius: 24px 24px 0 0; width: 100%; max-width: 500px; border: 1px solid var(--border); border-bottom: none; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.split-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; flex-shrink: 0; }
.split-close { background: none; border: none; color: var(--text2); font-size: 22px; cursor: pointer; }
.split-desc { padding: 10px 18px 6px; font-size: 13px; color: var(--text2); flex-shrink: 0; }
#splitItems { overflow-y: auto; flex: 1; padding: 4px 18px; display: flex; flex-direction: column; gap: 8px; }
.split-item { display: flex; align-items: center; gap:10px; background: var(--card); border-radius: 12px; padding: 10px 12px; border: 1px solid var(--border); }
.split-item-label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.split-item-label input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.split-item-name { font-size: 14px; font-weight: 600; }
.split-item-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.split-qty-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--text); width: 26px; height: 26px; border-radius: 7px; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.split-qty-val { font-weight: 700; min-width: 16px; text-align: center; font-size: 14px; }
.split-item-price { font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--accent); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.split-divider { height: 1px; background: var(--border); margin: 8px 18px; flex-shrink: 0; }
.split-by-count { display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-size: 13px; color: var(--text2); flex-shrink: 0; flex-wrap: wrap; }
.split-count-btn { background: var(--card); border: 1px solid var(--border); color: var(--text); width: 28px; height: 28px; border-radius: 8px; font-size: 16px; cursor: pointer; }
.split-even-btn { background: var(--accent2); color: var(--accent); border: none; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; margin-left: auto; }
.split-totals { padding: 8px 18px; flex-shrink: 0; }
.split-your-total { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; color: var(--success); margin-bottom: 4px; }
.split-full-total { font-size: 13px; color: var(--text2); }
.split-done { margin: 10px 18px 20px; background: var(--success); color: #0c0a09; border: none; padding: 13px; border-radius: 100px; font-size: 16px; font-weight: 700; cursor: pointer; flex-shrink: 0; }

/* --- Mobile Responsiveness --- */
@media (max-width: 400px) {
  .game-modal { padding: 14px; }
  .game-cell { font-size: 32px; border-radius: 10px; }
  .game-board { gap: 6px; margin-bottom: 14px; }
  .game-modal-header { font-size: 16px; margin-bottom: 10px; }
  .game-btn-rematch, .game-btn-leave { padding: 12px; font-size: 14px; }
  .rps-btn { padding: 10px 6px; font-size: 26px; }
  .rps-reveal { font-size: 36px; }
  .alias-timer { font-size: 48px; }
  .alias-word { font-size: 24px; padding: 16px 12px; }
  .alias-final-score { font-size: 48px; gap: 14px; }
  .draw-word { font-size: 18px; }
  .draw-color { width: 22px; height: 22px; }
}

@media (max-height: 680px) {
  .game-modal { padding: 12px; max-height: 100dvh; }
  .game-modal-header { margin-bottom: 8px; }
  .game-players { margin-bottom: 8px; gap: 8px; }
  .game-status { margin-bottom: 8px; font-size: 15px; }
  .game-board { gap: 6px; margin-bottom: 12px; }
  .game-cell { font-size: 28px; border-radius: 10px; }
  .game-overlay--draw .game-modal { height: 100dvh; border-radius: 0; }
  .rps-btn { padding: 8px 4px; font-size: 24px; }
  .rps-choices { gap: 6px; }
  .alias-timer { font-size: 42px; }
  .alias-word { font-size: 22px; padding: 14px 10px; }
  .bs-wrap { gap: 8px; }
  .bs-grid { gap: 2px; }
}

/* ═══ AI CHAT ═══ */
.ai-chat-btn { background: transparent; border: 1px solid var(--border); color: var(--text); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.ai-chat-btn:hover { border-color: #a78bfa; color: #a78bfa; }

.ai-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 600; display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.ai-modal { background: var(--bg); width: 100%; max-width: 480px; height: 85dvh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; border: 1px solid var(--border); border-bottom: none; overflow: hidden; }

.ai-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; flex-shrink: 0; }
.ai-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 4px; }

.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.ai-msg { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; max-width: 85%; word-wrap: break-word; animation: slideUpMsg 0.25s ease-out; }
@keyframes slideUpMsg { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }

.ai-msg-bot { background: var(--card); color: var(--text); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg-user { background: rgba(167,139,250,0.15); color: var(--text); border: 1px solid rgba(167,139,250,0.2); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg-typing { background: var(--card); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text2); font-style: italic; }

.ai-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg2); }
.ai-input { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 100px; padding: 10px 16px; color: var(--text); font-size: 15px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.ai-input:focus { border-color: #a78bfa; }
.ai-input::placeholder { color: var(--text2); }
.ai-send { background: #a78bfa; color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: opacity 0.2s, transform 0.1s; flex-shrink: 0; }
.ai-send:hover { opacity: 0.85; }
.ai-send:active { transform: scale(0.9); }
.ai-send:disabled { opacity: 0.4; cursor: default; }
