* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body, html { margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; overflow: hidden; width: 100vw; height: 100vh; background-color: #f4f5f9; color: #e2e2e2; user-select: none; -webkit-user-select: none; touch-action: none; }
#dynamic-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; transition: background 0.4s ease; pointer-events: none; }

.bg-solid { background-color: #0f0f13; }
.bg-dots { background-color: #0f0f13; background-image: radial-gradient(rgba(255,255,255,0.16) 1.5px, transparent 1.5px); background-size: 24px 24px; }
.bg-grid { background-color: #0f0f13; background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 30px 30px; }
.bg-magical { background: linear-gradient(-45deg, #0f0f13, #17172b, #142038, #0f3460, #0f0f13); background-size: 400% 400%; animation: gradientAurora 18s ease infinite; }
.bg-light-dots { background-color: #f5f7fb; background-image: radial-gradient(rgba(15, 23, 42, 0.16) 1.5px, transparent 1.5px); background-size: 24px 24px; }
.bg-light-grid { background-color: #f5f7fb; background-image: linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px); background-size: 30px 30px; }
.bg-light-paper { background-color: #fdf6e3; background-image: linear-gradient(rgba(181, 137, 0, 0.08) 1px, transparent 1px); background-size: 100% 28px; }
.bg-light-pastel { background: linear-gradient(120deg, #fdfbfb 0%, #ebedee 50%, #e0c3fc 100%); }
.bg-light-sakura { background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 50%, #f8edeb 100%); background-image: radial-gradient(rgba(255, 105, 180, 0.15) 1.5px, transparent 1.5px); background-size: 26px 26px; }
.bg-light-mint { background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%); background-image: radial-gradient(rgba(16, 185, 129, 0.15) 1.5px, transparent 1.5px); background-size: 26px 26px; }
.bg-blueprint { background-color: #0a2540; background-image: linear-gradient(rgba(0, 210, 255, 0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 210, 255, 0.14) 1px, transparent 1px); background-size: 28px 28px; }
.bg-cyberpunk { background-color: #060612; background-image: linear-gradient(rgba(0, 210, 255, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 71, 87, 0.09) 1px, transparent 1px); background-size: 36px 36px; box-shadow: inset 0 0 120px rgba(255, 0, 128, 0.15); }
.bg-matrix { background-color: #040d08; background-image: linear-gradient(rgba(0, 255, 128, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 128, 0.08) 1px, transparent 1px); background-size: 30px 30px; }
.bg-stars { background-color: #030308; background-image: radial-gradient(white, rgba(255,255,255,.2) 1.5px, transparent 3px), radial-gradient(white, rgba(255,255,255,.12) 1px, transparent 2px); background-size: 450px 450px, 250px 250px; background-position: 0 0, 40px 60px; }

@keyframes gradientAurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.fade-in { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lobby-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; padding: 16px; background: radial-gradient(circle at center, #1a1a24 0%, #0f0f13 100%); z-index: 10; position: relative; }
.logo-glow { font-size: 2.5rem; margin-bottom: 2rem; color: #00d2ff; text-shadow: 0 0 15px rgba(0, 210, 255, 0.4); }
.lobby-container form { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 340px; background: rgba(255,255,255,0.03); padding: 28px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(10px); }
.lobby-container input, .lobby-container button { padding: 14px; border-radius: 8px; border: none; font-size: 15px; outline: none; transition: all 0.2s; }
.lobby-container input { background-color: #1a1a24; color: #fff; border: 1px solid #333; user-select: text; -webkit-user-select: text; }
.lobby-container input:focus { border-color: #00d2ff; box-shadow: 0 0 8px rgba(0, 210, 255, 0.2); }
.lobby-container button { background-color: #00d2ff; color: #000; cursor: pointer; font-weight: 700; }
.lobby-container button:hover { background-color: #00a8cc; transform: translateY(-2px); }

#workspace { position: absolute; top: 0; left: 0; width: 5000px; height: 5000px; transform-origin: 0 0; z-index: 1; will-change: transform; }
#board { position: absolute; top: 0; left: 0; width: 5000px; height: 5000px; z-index: 2; cursor: crosshair; touch-action: none; -webkit-user-drag: none; }
#draft-board { position: absolute; top: 0; left: 0; width: 5000px; height: 5000px; z-index: 3; pointer-events: none; }
#laser-board { position: absolute; top: 0; left: 0; width: 5000px; height: 5000px; z-index: 4; pointer-events: none; }
#board.pan-mode { cursor: grab; }
#board.pan-mode:active { cursor: grabbing; }
#text-layer, #board-media-container, #sticky-container, #stamps-layer, #cursors-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
#text-layer { z-index: 8; }
#board-media-container { z-index: 6; }
#sticky-container { z-index: 7; }
#stamps-layer { z-index: 22; }
#cursors-container { z-index: 25; }

#ui-layer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; transition: opacity 0.25s ease; }
.bottom-status-bar, .floating-widget { pointer-events: auto; }
body.focus-mode #ui-layer { opacity: 0; pointer-events: none !important; }
body.focus-mode #ui-layer * { pointer-events: none !important; }

.glass-effect { background: rgba(20, 20, 28, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 10px 35px rgba(0,0,0,0.6); }
body.light-theme .glass-effect { background: rgba(255, 255, 255, 0.96); border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 10px 30px rgba(0,0,0,0.14); color: #1e272e; }

.top-bar-container { position: fixed; top: 8px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 58; pointer-events: none; }
.top-right-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; pointer-events: auto; }
.bottom-dock-container { position: fixed; bottom: 10px; left: 140px; right: 64px; display: flex; justify-content: center; align-items: center; z-index: 56; pointer-events: none; }

.scroll-strip-wrap { display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; flex: 1; justify-content: center; pointer-events: none; }
.scroll-strip { display: flex; flex-wrap: nowrap !important; align-items: center; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; padding: 4px 2px; max-width: 100%; pointer-events: auto; touch-action: pan-x; }
.scroll-strip::-webkit-scrollbar { display: none; }

.scroll-arrow-btn { pointer-events: auto; width: 32px; height: 36px; border-radius: 18px; border: 1px solid rgba(0, 210, 255, 0.45); background: rgba(15, 15, 22, 0.95); color: #00d2ff; font-size: 13px; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.5); touch-action: manipulation; transition: transform 0.15s, background 0.15s; }
.scroll-arrow-btn:hover { background: #00d2ff; color: #000; transform: scale(1.06); }
body.light-theme .scroll-arrow-btn { background: rgba(255,255,255,0.96); color: #0984e3; border-color: rgba(9,132,227,0.4); }

.info-pill { flex-shrink: 0; background: rgba(20, 20, 28, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.16); padding: 6px 11px; min-height: 36px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; color: #eee; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,0.42); white-space: nowrap; }
body.light-theme .info-pill { background: rgba(255,255,255,0.95); color: #222; border-color: rgba(0,0,0,0.14); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.room-badge b { color: #00d2ff; }
body.light-theme .room-badge b { color: #0984e3; }
.user-pill { cursor: pointer; font-weight: 600; touch-action: manipulation; }
.user-pill b { color: #feca57; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.light-theme .user-pill b { color: #d68910; }
.mini-btn { color: #00d2ff; border-color: rgba(0, 210, 255, 0.4); font-weight: 700; cursor: pointer; touch-action: manipulation; }
.mini-btn:hover { background: #00d2ff; color: #000; }
.online-badge { color: #55efc4; font-weight: 600; }
body.light-theme .online-badge { color: #00b894; }

.ping-badge { font-family: monospace; font-size: 11px; gap: 6px; }
.ping-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ping-dot.good { background: #2ed573; box-shadow: 0 0 6px #2ed573; }
.ping-dot.medium { background: #ffa502; box-shadow: 0 0 6px #ffa502; }
.ping-dot.bad { background: #ff4757; box-shadow: 0 0 6px #ff4757; }

.toolbar button, .group-trigger-btn { flex-shrink: 0; background: rgba(20, 20, 28, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #d2dae2; border: 1px solid rgba(255,255,255,0.16); box-shadow: 0 4px 14px rgba(0,0,0,0.42); padding: 6px 12px; min-height: 36px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; transition: all 0.15s ease; touch-action: manipulation; }
.toolbar button em, .group-trigger-btn em { font-style: normal; font-size: 14px; }
.group-trigger-btn small { font-size: 10px; opacity: 0.75; margin-left: 2px; }
.toolbar button:hover, .group-trigger-btn:hover { color: #fff; background: rgba(35, 35, 48, 0.96); border-color: rgba(255,255,255,0.3); }
body.light-theme .toolbar button, body.light-theme .group-trigger-btn { background: rgba(255,255,255,0.95); color: #2d3436; border-color: rgba(0,0,0,0.14); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.toolbar button.active, .group-trigger-btn.active { background: #00d2ff !important; color: #000 !important; border-color: #00d2ff !important; font-weight: 700; box-shadow: 0 0 14px rgba(0, 210, 255, 0.45); }
.toolbar .danger-btn { color: #ff6b81; border-color: rgba(255, 107, 129, 0.35); }
.toolbar .danger-btn:hover { background: #ff4757 !important; color: #fff !important; border-color: #ff4757 !important; }

.color-preview-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; display: inline-block; flex-shrink: 0; box-shadow: 0 0 4px rgba(0,0,0,0.4); }

.tool-popover { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); width: 295px; max-width: calc(100vw - 20px); border-radius: 16px; padding: 12px; display: none !important; flex-direction: column; gap: 10px; z-index: 95; pointer-events: none; }
.tool-popover.open { display: flex !important; pointer-events: auto !important; animation: fadeIn 0.15s ease-out; }
.popover-title { font-size: 11px; font-weight: 800; color: #00d2ff; text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.1); }
body.light-theme .popover-title { color: #0984e3; border-color: rgba(0,0,0,0.1); }
.popover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.popover-grid.single-col { grid-template-columns: 1fr; }
.sub-tool-btn, .sub-shape-btn, .game-menu-btn, .screen-mode-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #eee; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.14s; touch-action: manipulation; }
body.light-theme .sub-tool-btn, body.light-theme .sub-shape-btn, body.light-theme .game-menu-btn, body.light-theme .screen-mode-btn { background: rgba(0,0,0,0.05); color: #222; border-color: rgba(0,0,0,0.12); }
.sub-tool-btn:hover, .sub-shape-btn:hover, .game-menu-btn:hover, .screen-mode-btn:hover { background: rgba(0, 210, 255, 0.18); border-color: #00d2ff; }
.sub-tool-btn.active, .sub-shape-btn.active { background: #00d2ff; color: #000; border-color: #00d2ff; font-weight: 700; }
.screen-mode-btn.stop-mode { background: rgba(255, 71, 87, 0.18); color: #ff4757; border-color: #ff4757; font-weight: 700; }

.stamp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stamp-opt-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; font-size: 22px; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; touch-action: manipulation; }
body.light-theme .stamp-opt-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
.stamp-opt-btn:hover, .stamp-opt-btn.active { transform: scale(1.18); border-color: #00d2ff; background: rgba(0, 210, 255, 0.2); }

.floating-stamp { position: absolute; pointer-events: none; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); animation: stampFloatUp 2.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; z-index: 25; }
.floating-stamp .stamp-emoji { font-size: 46px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35)); }
.floating-stamp .stamp-sender { font-size: 11px; font-weight: 800; background: rgba(0,0,0,0.75); color: #fff; padding: 2px 8px; border-radius: 10px; margin-top: -4px; white-space: nowrap; }
@keyframes stampFloatUp {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.3); }
    15% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); }
    30% { transform: translate(-45%, -85%) scale(1.0); }
    65% { opacity: 0.95; transform: translate(-55%, -140%) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -210%) scale(0.8); }
}

.style-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#color-picker { -webkit-appearance: none; appearance: none; background: none; border: 2px solid rgba(255,255,255,0.5); padding: 0; width: 32px; height: 32px; cursor: pointer; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
#color-picker::-webkit-color-swatch-wrapper { padding: 0; }
#color-picker::-webkit-color-swatch { border: none; border-radius: 50%; }
.quick-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.qcolor { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 1.5px solid rgba(128,128,128,0.4); transition: transform 0.15s; flex-shrink: 0; touch-action: manipulation; }
.qcolor:hover, .qcolor.active { transform: scale(1.2); border-color: #00d2ff; box-shadow: 0 0 8px rgba(0,210,255,0.5); }
.style-slider-group { display: flex; flex-direction: column; gap: 4px; }
.slider-header { display: flex; justify-content: space-between; font-size: 12px; color: #ccc; }
body.light-theme .slider-header { color: #333; }
.style-slider-group input[type="range"] { width: 100%; accent-color: #00d2ff; cursor: pointer; }

.dock-btn { flex-shrink: 0; background: rgba(20, 20, 28, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #feca57; border: 1px solid rgba(254, 202, 87, 0.38); box-shadow: 0 6px 18px rgba(0,0,0,0.48); padding: 8px 14px; min-height: 38px; border-radius: 24px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; transition: all 0.16s ease; touch-action: manipulation; }
body.light-theme .dock-btn { color: #b7791f; background: rgba(255,255,255,0.95); border-color: rgba(183, 121, 31, 0.35); box-shadow: 0 5px 15px rgba(0,0,0,0.12); }
.dock-btn:hover { background: rgba(35, 35, 48, 0.96); border-color: #feca57; }
.dock-btn.active { background: #feca57 !important; color: #000 !important; border-color: #feca57 !important; box-shadow: 0 0 18px rgba(254, 202, 87, 0.55); }
.dock-btn.highlight-dock { color: #00d2ff; border-color: rgba(0, 210, 255, 0.48); }
body.light-theme .dock-btn.highlight-dock { color: #0984e3; border-color: rgba(9, 132, 227, 0.45); }
.dock-btn.highlight-dock:hover { background: #00d2ff !important; color: #000 !important; }
.dock-btn.secondary { color: #e2e8f0; border-color: rgba(255,255,255,0.2); }
body.light-theme .dock-btn.secondary { color: #2d3436; border-color: rgba(0,0,0,0.18); }

.badge-dot { background: #ff4757; color: #fff; font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 2px; }

.fab-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: all 0.2s ease; color: #fff; padding: 0; touch-action: manipulation; }
body.light-theme .fab-btn { color: #222; }
.fab-btn:hover, .fab-btn.active { background: rgba(0, 210, 255, 0.25); border-color: #00d2ff; transform: scale(1.06); }
.focus-fab { position: fixed; bottom: 10px; right: 12px; z-index: 120; pointer-events: auto !important; }

.bottom-status-bar { position: fixed; bottom: 10px; left: 12px; padding: 4px 8px; border-radius: 24px; font-size: 12px; color: #ddd; z-index: 55; display: flex; align-items: center; gap: 6px; }
body.light-theme .bottom-status-bar { color: #222; }
.zoom-step-btn { background: rgba(255,255,255,0.12); color: inherit; border: none; width: 28px; height: 28px; border-radius: 50%; font-size: 16px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; touch-action: manipulation; }
.zoom-step-btn:hover { background: #00d2ff; color: #000; }
#zoom-indicator { min-width: 44px; text-align: center; font-weight: 700; cursor: pointer; user-select: none; }

.widget-resizer { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; z-index: 30; touch-action: none; background: linear-gradient(135deg, transparent 50%, rgba(0, 210, 255, 0.75) 50%); border-bottom-right-radius: 10px; pointer-events: auto; }
.widget-resizer:hover { background: linear-gradient(135deg, transparent 40%, #00d2ff 40%); }

.board-text-box { position: absolute; min-width: 150px; min-height: 54px; background: transparent !important; border: 1.5px dashed transparent !important; border-radius: 8px; pointer-events: auto; display: flex; flex-direction: column; transition: border-color 0.15s, background 0.15s; touch-action: none; }
.board-text-box .text-box-toolbar { display: none !important; opacity: 0 !important; pointer-events: none !important; align-items: center; justify-content: space-between; gap: 5px; background: rgba(20, 20, 28, 0.95); border: 1px solid rgba(0, 210, 255, 0.55); border-radius: 10px; padding: 4px 8px; position: absolute; top: -40px; left: 0; white-space: nowrap; z-index: 25; box-shadow: 0 6px 16px rgba(0,0,0,0.45); }
.board-text-box .widget-resizer { display: none !important; opacity: 0 !important; pointer-events: none !important; }
.board-text-box.editing { border: 1.5px dashed #00d2ff !important; background: rgba(15, 15, 24, 0.08) !important; }
body.light-theme .board-text-box.editing { border: 1.5px dashed #0984e3 !important; background: rgba(255, 255, 255, 0.45) !important; }
.board-text-box.editing .text-box-toolbar { display: inline-flex !important; opacity: 1 !important; pointer-events: auto !important; }
.board-text-box.editing .widget-resizer { display: block !important; opacity: 1 !important; pointer-events: auto !important; }
.tbox-drag-handle { cursor: grab; font-size: 11px; color: #00d2ff; font-weight: 700; padding: 2px 6px; user-select: none; }
.tbox-drag-handle:active { cursor: grabbing; }
.tbox-btn { background: rgba(255,255,255,0.14); border: none; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; cursor: pointer; touch-action: manipulation; }
.tbox-btn:hover { background: #00d2ff; color: #000; }
.tbox-btn.del { color: #ff6b81; }
.tbox-btn.del:hover { background: #ff4757; color: #fff; }
.tbox-color-wrap { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; border-left: 1px solid rgba(255,255,255,0.18); border-right: 1px solid rgba(255,255,255,0.18); }
.tbox-color-dot { width: 15px; height: 15px; border-radius: 50%; cursor: pointer; border: 1.5px solid rgba(255,255,255,0.7); transition: transform 0.12s; }
.tbox-color-dot:hover { transform: scale(1.25); }
.tbox-color-input { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border: 1.5px solid #fff; border-radius: 50%; padding: 0; background: none; cursor: pointer; overflow: hidden; }
.tbox-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.tbox-color-input::-webkit-color-swatch { border: none; border-radius: 50%; }
.text-box-editor { flex: 1; width: 100%; height: 100%; min-height: 44px; padding: 8px 10px; border: none; outline: none; resize: none; background: transparent; color: #0984e3; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-size: 20px; line-height: 1.35; user-select: text !important; -webkit-user-select: text !important; cursor: text; touch-action: auto; overflow: auto; }
.text-box-editor::placeholder { color: transparent; }
.board-text-box.editing .text-box-editor::placeholder { color: rgba(120, 130, 150, 0.65); font-weight: 500; }

.screen-body { background: #050508; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; position: relative; }
#screen-video, #screen-fallback-img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.live-stream-badge { background: #ff4757; color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 12px; letter-spacing: 0.5px; animation: pulseBanner 1s infinite alternate; }

.settings-overlay { position: fixed; top: 56px; right: 12px; width: 310px; max-width: calc(100vw - 24px); border-radius: 14px; display: none !important; flex-direction: column; z-index: 85; pointer-events: none; }
.settings-overlay.active { display: flex !important; pointer-events: auto !important; animation: fadeIn 0.18s ease-out; }
.settings-header { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #00d2ff; font-size: 13px; }
.settings-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; max-height: 78vh; overflow-y: auto; touch-action: pan-y; }
.setting-group label { font-size: 11px; color: #999; margin-bottom: 8px; display: block; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.bg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bg-opt-btn, .eraser-opt-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); padding: 8px 10px; min-height: 36px; border-radius: 8px; color: #ddd; font-size: 12px; cursor: pointer; transition: all 0.15s; touch-action: manipulation; text-align: left; }
body.light-theme .bg-opt-btn, body.light-theme .eraser-opt-btn { color: #333; background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
.bg-opt-btn:hover, .eraser-opt-btn:hover { background: rgba(255,255,255,0.14); }
.bg-opt-btn.active, .eraser-opt-btn.active { background: rgba(0, 210, 255, 0.22); border-color: #00d2ff; color: #00d2ff; font-weight: 700; }
body.light-theme .bg-opt-btn.active, body.light-theme .eraser-opt-btn.active { color: #0984e3; border-color: #0984e3; }
.toggle-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; align-items: center; min-height: 28px; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #00d2ff; cursor: pointer; }

.cursor { position: absolute; top: 0; left: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; transition: transform 0.04s linear; z-index: 30; }
.cursor-dot { width: 14px; height: 14px; background-color: #ff4757; border-radius: 50%; box-shadow: 0 0 10px rgba(255,71,87,0.9); border: 2px solid #fff; transition: transform 0.15s; }
.cursor.touching .cursor-dot { transform: scale(1.45); background-color: #00d2ff; box-shadow: 0 0 14px #00d2ff; }
.cursor-name { background: rgba(0,0,0,0.85); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; margin-top: 4px; white-space: nowrap; border: 1px solid rgba(255,255,255,0.2); }
.local-touch-badge { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 32; transform: translate(-50%, -130%); background: rgba(0, 210, 255, 0.9); color: #000; font-weight: 800; font-size: 11px; padding: 3px 8px; border-radius: 10px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.hide-cursors .cursor { display: none !important; }
.hide-names .cursor-name { display: none !important; }

.sticky-note { position: absolute; width: 245px; min-width: 190px; min-height: 150px; background: #ffeaa7; border-radius: 14px; box-shadow: 0 12px 28px rgba(0,0,0,0.32); display: flex; flex-direction: column; pointer-events: auto; animation: popIn 0.2s ease-out; touch-action: none; overflow: hidden; }
.sticky-note.dragging { box-shadow: 0 18px 42px rgba(0,0,0,0.55); opacity: 0.96; }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sticky-header { height: 38px; background: rgba(0,0,0,0.09); cursor: grab; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; touch-action: none; flex-shrink: 0; }
.sticky-header:active { cursor: grabbing; }
.sticky-colors { display: flex; gap: 5px; align-items: center; }
.scolor { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; border: 1.5px solid rgba(0,0,0,0.28); transition: transform 0.15s; touch-action: manipulation; }
.scolor:hover { transform: scale(1.2); }
.scolor.y { background: #ffeaa7; } .scolor.g { background: #55efc4; } .scolor.p { background: #fd79a8; } .scolor.b { background: #74b9ff; } .scolor.v { background: #d6a2e8; } .scolor.o { background: #fab1a0; }
.sticky-tools-right { display: flex; align-items: center; gap: 3px; }
.sticky-mini-btn { background: rgba(255,255,255,0.45); border: none; color: #222; font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 5px; cursor: pointer; touch-action: manipulation; }
.sticky-mini-btn:hover { background: #fff; }
.sticky-del { background: rgba(214, 48, 49, 0.18); border: none; color: #d63031; font-weight: 800; cursor: pointer; font-size: 13px; padding: 2px 7px; border-radius: 6px; touch-action: manipulation; }
.sticky-del:hover { background: #d63031; color: #fff; }
.sticky-meta-bar { padding: 3px 10px; font-size: 10px; color: rgba(0,0,0,0.55); font-weight: 700; display: flex; justify-content: space-between; background: rgba(255,255,255,0.22); }
.sticky-content { flex: 1; width: 100%; padding: 10px 12px; border: none; outline: none; resize: none; background: transparent; color: #1e272e; font-family: 'Inter', system-ui, sans-serif; font-size: 15px; line-height: 1.45; user-select: text !important; -webkit-user-select: text !important; cursor: text; touch-action: auto; }

.board-media-card { position: absolute; width: 420px; height: 340px; min-width: 260px; min-height: 180px; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; pointer-events: auto; box-shadow: 0 14px 36px rgba(0,0,0,0.55); animation: popIn 0.2s ease-out; touch-action: none; }
.board-media-body { width: 100%; flex: 1; background: #09090d; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: auto; padding: 6px; touch-action: pan-x pan-y; }
.board-media-body img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.board-media-body video { width: 100%; height: 100%; border-radius: 8px; background: #000; object-fit: contain; }
.board-media-body audio { width: 95%; margin: 12px 0; }
.board-media-body iframe, .board-media-body embed { width: 100%; height: 100%; border: none; border-radius: 8px; background: #fff; }

.board-widget { position: absolute; border-radius: 14px; display: flex; flex-direction: column; z-index: 15; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,0.65); pointer-events: auto; touch-action: none; min-width: 300px; min-height: 240px; }
.floating-widget { position: fixed; border-radius: 14px; display: flex; flex-direction: column; z-index: 65; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,0.65); pointer-events: auto; touch-action: none; }
.chat-widget { bottom: 62px; right: 14px; width: 340px; height: 400px; min-width: 260px; min-height: 220px; max-width: calc(100vw - 24px); max-height: calc(100vh - 130px); }
.board-widget.minimized .widget-body, .floating-widget.minimized .widget-body, .board-widget.minimized .widget-resizer, .floating-widget.minimized .widget-resizer { display: none !important; }
.board-widget.minimized, .floating-widget.minimized { height: auto !important; min-height: 0 !important; }

.widget-header { padding: 8px 12px; min-height: 44px; background: rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: space-between; cursor: grab; border-bottom: 1px solid rgba(255, 255, 255, 0.1); touch-action: none; gap: 6px; flex-shrink: 0; }
.widget-header:active { cursor: grabbing; }
.widget-title { font-weight: 700; font-size: 13px; color: #00d2ff; pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.light-theme .widget-title { color: #0984e3; }
.widget-controls { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.widget-btn { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); color: #eee; border-radius: 8px; padding: 5px 9px; min-width: 32px; min-height: 30px; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; touch-action: manipulation; pointer-events: auto; }
.widget-btn:hover { color: #fff; background: rgba(0, 210, 255, 0.3); border-color: #00d2ff; }
body.light-theme .widget-btn { color: #222; background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.15); }
.widget-btn.close:hover { background: #ff4757 !important; border-color: #ff4757 !important; color: #fff !important; }
.widget-body { display: flex; flex-direction: column; flex: 1; overflow: hidden; position: relative; }

.xo-status { padding: 8px 12px; font-size: 13px; text-align: center; background: rgba(0,0,0,0.22); border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
body.light-theme .xo-status { background: rgba(0,0,0,0.05); color: #222; }
.xo-board-wrapper { padding: 10px; flex: 1; display: flex; justify-content: center; align-items: center; overflow: auto; touch-action: pan-x pan-y; }
.xo-board { display: grid; grid-template-columns: repeat(20, 22px); grid-template-rows: repeat(20, 22px); gap: 2px; background: rgba(255, 255, 255, 0.08); padding: 4px; border-radius: 8px; }
.xo-cell { width: 22px; height: 22px; background: #15151e; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; cursor: pointer; touch-action: manipulation; }
.xo-cell:hover { background: #262638; }
body.light-theme .xo-cell { background: #e2e6ea; }
body.light-theme .xo-cell:hover { background: #cbd3da; }
.xo-cell.x { color: #00d2ff; }
.xo-cell.o { color: #ff4757; }
.xo-cell.win { background: #feca57 !important; color: #000 !important; }

.chess-board-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px; position: relative; overflow: auto; }
.chess-board { display: grid; grid-template-columns: repeat(8, 52px); grid-template-rows: repeat(8, 52px); border: 4px solid #3c3a38; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); overflow: hidden; flex-shrink: 0; }
.chess-sq { width: 52px; height: 52px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; touch-action: manipulation; }
.chess-sq.light { background-color: #ebecd0; color: #739552; }
.chess-sq.dark { background-color: #739552; color: #ebecd0; }
.chess-sq.selected { background-color: #baca44 !important; }
.chess-sq.last-move.light { background-color: #f5f682 !important; }
.chess-sq.last-move.dark { background-color: #b9ca43 !important; }
.chess-sq.in-check { background: radial-gradient(circle, #ff4757 20%, rgba(255,0,0,0.65) 70%, transparent 100%) !important; }
.chess-piece-img { width: 46px; height: 46px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); transition: transform 0.12s; }
.chess-sq:hover .chess-piece-img { transform: scale(1.06); }
.chess-move-dot { width: 16px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, 0.22); pointer-events: none; }
.chess-capture-ring { position: absolute; inset: 3px; border: 4.5px solid rgba(0, 0, 0, 0.24); border-radius: 50%; pointer-events: none; }
.chess-coord { position: absolute; font-size: 9px; font-weight: 800; pointer-events: none; line-height: 1; }
.chess-coord.rank { top: 3px; left: 3px; }
.chess-coord.file { bottom: 2px; right: 3px; }
.chess-history-bar { padding: 6px 12px; font-size: 11px; background: rgba(0,0,0,0.25); color: #ccc; white-space: nowrap; overflow-x: auto; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
body.light-theme .chess-history-bar { background: rgba(0,0,0,0.06); color: #333; }
.chess-promo-modal { position: absolute; inset: 0; background: rgba(0,0,0,0.75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 25; }
.promo-title { color: #fff; font-weight: 800; font-size: 14px; }
.promo-choices { display: flex; gap: 10px; background: #ebecd0; padding: 10px; border-radius: 12px; }
.promo-btn { width: 56px; height: 56px; border: 2px solid #739552; border-radius: 10px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 4px; }
.promo-btn:hover { background: #f5f682; transform: scale(1.08); }
.promo-btn img { width: 100%; height: 100%; object-fit: contain; }

.memory-grid-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: auto; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 72px); grid-template-rows: repeat(4, 72px); gap: 8px; }
.memory-card { width: 72px; height: 72px; border-radius: 12px; background: linear-gradient(135deg, #00d2ff, #0984e3); color: #fff; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.2s, background 0.2s; touch-action: manipulation; }
.memory-card:hover { transform: scale(1.05); }
.memory-card.revealed { background: #fff; color: #222; border: 2px solid #00d2ff; }
.memory-card.matched { background: #55efc4; color: #000; border: 2px solid #00b894; cursor: default; }

.media-controls { padding: 10px 12px; background: rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.media-controls.collapsed { display: none !important; }
.media-input-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.media-input-row input[type="text"] { flex: 1; min-width: 180px; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.45); color: #fff; font-size: 12px; user-select: text; -webkit-user-select: text; touch-action: auto; }
.media-input-row input[type="file"] { flex: 1; min-width: 160px; font-size: 11px; color: #ddd; background: rgba(255,255,255,0.05); padding: 5px; border-radius: 6px; border: 1px dashed rgba(255,255,255,0.2); cursor: pointer; }
.media-input-row button { padding: 8px 12px; min-height: 34px; border-radius: 6px; border: none; background: #00d2ff; color: #000; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.media-input-row button.pin-btn { background: #feca57; color: #000; }
.media-history-bar { display: flex; gap: 6px; overflow-x: auto; padding-top: 2px; scrollbar-width: thin; }
.media-chip { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #ddd; padding: 4px 10px; border-radius: 14px; font-size: 11px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; touch-action: manipulation; }
.media-chip:hover { background: rgba(0, 210, 255, 0.22); border-color: #00d2ff; color: #fff; }
.media-content { width: 100%; flex: 1; min-height: 220px; background: #08080c; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: auto; position: relative; touch-action: pan-x pan-y; }
.empty-media-box { padding: 24px; text-align: center; }
.empty-media-text { color: #aaa; font-size: 13px; line-height: 1.5; margin: 0; }
.media-content iframe, .media-content video, .media-content embed { width: 100%; height: 100%; min-height: 260px; border: none; object-fit: contain; background: #000; }
.media-content img { max-width: 100%; max-height: 100%; object-fit: contain; }
.audio-player-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; width: 100%; }
.audio-player-title { color: #00d2ff; font-weight: 700; font-size: 14px; text-align: center; word-break: break-word; }
.unlock-audio-banner { width: 100%; background: linear-gradient(90deg, #ff4757, #ff6b81); color: #fff; border: none; padding: 10px 14px; font-size: 13px; font-weight: 800; cursor: pointer; text-align: center; animation: pulseBanner 1.2s infinite alternate; touch-action: manipulation; flex-shrink: 0; }
@keyframes pulseBanner { from { opacity: 0.88; } to { opacity: 1; } }

.doc-viewer-wrapper { width: 100%; height: 100%; min-height: 260px; display: flex; flex-direction: column; background: #fff; color: #1e272e; overflow: hidden; user-select: text; -webkit-user-select: text; flex: 1; }
.doc-toolbar-bar { background: #1e272e; color: #fff; padding: 6px 12px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-shrink: 0; }
.doc-toolbar-bar a { color: #00d2ff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.excel-sheet-tabs { display: flex; gap: 4px; background: #f1f2f6; padding: 5px 8px; border-bottom: 1px solid #ccc; overflow-x: auto; flex-shrink: 0; }
.excel-tab-btn { background: #dfe4ea; color: #2f3542; border: 1px solid #ced6e0; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
.excel-tab-btn.active { background: #0984e3; color: #fff; border-color: #0984e3; }
.excel-table-wrap { flex: 1; overflow: auto; padding: 8px; background: #fff; touch-action: pan-x pan-y; }
.excel-table-wrap table { border-collapse: collapse; width: 100%; font-size: 12px; color: #222; }
.excel-table-wrap td, .excel-table-wrap th { border: 1px solid #dcdde1; padding: 5px 8px; text-align: left; white-space: nowrap; }
.excel-table-wrap tr:nth-child(even) { background: #f8f9fa; }
.word-doc-view { flex: 1; overflow: auto; padding: 16px 20px; background: #fff; color: #1e272e; font-size: 14px; line-height: 1.6; touch-action: pan-x pan-y; }
.word-doc-view table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.word-doc-view td, .word-doc-view th { border: 1px solid #ccc; padding: 6px; }
.text-doc-view { flex: 1; overflow: auto; margin: 0; padding: 14px; background: #14141d; color: #55efc4; font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; touch-action: pan-x pan-y; }
.html-preview-frame { width: 100%; flex: 1; height: 100%; min-height: 250px; border: none; background: #fff; }

.chat-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; padding: 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; user-select: text; -webkit-user-select: text; touch-action: pan-y; }
.chat-item { background: rgba(255,255,255,0.06); padding: 7px 10px; border-radius: 8px; line-height: 1.4; word-break: break-word; }
body.light-theme .chat-item { background: rgba(0,0,0,0.06); }
.chat-item .chat-meta { font-size: 10px; color: #00d2ff; font-weight: 700; margin-bottom: 2px; display: flex; justify-content: space-between; }
.chat-item.self { background: rgba(0, 210, 255, 0.15); border: 1px solid rgba(0, 210, 255, 0.3); }
.chat-input-row { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.25); margin: 0; width: 100%; box-shadow: none; flex-shrink: 0; }
.chat-input-row input { flex: 1; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.4); color: #fff; font-size: 12px; user-select: text; -webkit-user-select: text; touch-action: auto; }
body.light-theme .chat-input-row input { background: #fff; color: #222; border-color: rgba(0,0,0,0.2); }
.chat-input-row button { padding: 8px 14px; min-height: 34px; border-radius: 6px; border: none; background: #00d2ff; color: #000; font-weight: 700; font-size: 12px; cursor: pointer; touch-action: manipulation; }

.name-modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: auto; }
.name-modal-box { width: 100%; max-width: 380px; padding: 26px 24px; border-radius: 18px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.name-modal-box h3 { margin: 0; font-size: 18px; }
.name-modal-box p { margin: 0; font-size: 13px; color: #bbb; line-height: 1.45; }
body.light-theme .name-modal-box p { color: #555; }
.name-modal-box form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.name-modal-box input { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(0, 210, 255, 0.45); background: rgba(0,0,0,0.4); color: #fff; font-size: 15px; outline: none; user-select: text; -webkit-user-select: text; }
body.light-theme .name-modal-box input { background: #fff; color: #111; }
.name-modal-box button { padding: 12px; border-radius: 10px; border: none; background: #00d2ff; color: #000; font-size: 15px; font-weight: 800; cursor: pointer; }

#toast-container { position: fixed; bottom: 66px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 250; pointer-events: none; }
.toast-msg { background: rgba(20, 20, 28, 0.95); color: #fff; border: 1px solid rgba(0, 210, 255, 0.45); padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,0.45); animation: fadeIn 0.2s ease; }

@media (max-width: 768px) {
    .top-bar-container { top: 6px; left: 6px; right: 6px; gap: 4px; }
    .info-pill, .toolbar button, .group-trigger-btn { padding: 5px 9px; min-height: 32px; font-size: 11px; }
    .bottom-dock-container { bottom: 48px; left: 6px; right: 6px; }
    .dock-btn { padding: 6px 11px; min-height: 34px; font-size: 12px; }
    .bottom-status-bar { bottom: 6px; left: 6px; padding: 3px 6px; }
    .focus-fab { bottom: 6px; right: 6px; width: 36px; height: 36px; font-size: 16px; }
    .fab-btn { width: 36px; height: 36px; font-size: 16px; }
    .chat-widget { bottom: 92px; right: 8px; left: 8px; width: auto; height: 340px; }
}
