/* ── Variables ── */
:root {
  --bg: #0f1923;
  --surface: #1a2733;
  --border: #2a3f52;
  --header-bg: #e63946;
  --header-text: #fff;
  --cell-bg: #1e3044;
  --cell-text: #e0e8f0;
  --cell-hover: #253d54;
  --marked-bg: #2ecc71;
  --marked-text: #0f1923;
  --free-bg: #f1c40f;
  --free-text: #1a1a2e;
  --accent: #3498db;
  --card-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --pattern-color: #e67e22;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--cell-text); font-family: 'Fredoka', sans-serif; min-height: 100vh; padding: 20px; }
.screen { display: none; }
.screen.active { display: block; }

/* ── Top Bar ── */
.top-bar { text-align: center; margin-bottom: 24px; }
.top-bar h1 { font-size: 2.2rem; font-weight: 700; background: linear-gradient(135deg, #e63946, #f1c40f, #2ecc71, #3498db); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 2px; }
.top-bar p { color: #6a8fa8; margin-top: 4px; font-size: .95rem; }

/* ── Lobby ── */
#lobby.active { display: flex; min-height: calc(100vh - 40px); align-items: center; justify-content: center; }
.lobby-wrap { max-width: 440px; width: 100%; }

/* ── Animations ── */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(24px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cardAppear { 0% { transform: scale(.85) rotateY(60deg); opacity: 0; } 100% { transform: scale(1) rotateY(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 20px rgba(241,196,15,.2); } 50% { box-shadow: 0 0 40px rgba(241,196,15,.5); } }
@keyframes ballSpin { 0% { transform: scale(1) rotate(0deg); } 25% { transform: scale(.85) rotate(90deg); } 50% { transform: scale(.85) rotate(180deg); } 75% { transform: scale(.85) rotate(270deg); } 100% { transform: scale(1) rotate(360deg); } }
@keyframes ballPop { 0% { transform: scale(.5); opacity: .5; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ── Lobby elements ── */
.lobby-balls { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.lobby-ball { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.2rem; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.lobby-ball:nth-child(1) { background: radial-gradient(circle at 35% 35%, #e63946dd, #e6394688); animation: float 3s ease-in-out infinite; }
.lobby-ball:nth-child(2) { background: radial-gradient(circle at 35% 35%, #f1c40fdd, #f1c40f88); animation: float 3s ease-in-out .3s infinite; }
.lobby-ball:nth-child(3) { background: radial-gradient(circle at 35% 35%, #2ecc71dd, #2ecc7188); animation: float 3s ease-in-out .6s infinite; }
.lobby-ball:nth-child(4) { background: radial-gradient(circle at 35% 35%, #3498dbdd, #3498db88); animation: float 3s ease-in-out .9s infinite; }
.lobby-ball:nth-child(5) { background: radial-gradient(circle at 35% 35%, #9b59b6dd, #9b59b688); animation: float 3s ease-in-out 1.2s infinite; }
.lobby-title { font-size: 2rem; font-weight: 700; letter-spacing: 3px; text-align: center; background: linear-gradient(135deg, #e63946, #f1c40f, #2ecc71, #3498db); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: shimmer 4s linear infinite; margin-bottom: 4px; }
.lobby-sub { text-align: center; color: #6a8fa8; font-size: .85rem; margin-bottom: 28px; }
.lobby-input { width: 100%; padding: 14px 18px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--cell-text); font-family: 'Fredoka', sans-serif; font-size: 1rem; outline: none; transition: all .2s; }
.lobby-input:focus { border-color: var(--free-bg); box-shadow: 0 0 20px rgba(241,196,15,.12); }
.lobby-input::placeholder { color: #4a6070; }
.lobby-input.code-input { text-align: center; letter-spacing: 6px; font-size: 1.3rem; font-family: 'JetBrains Mono', monospace; font-weight: 700; text-transform: uppercase; }
.lobby-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--card-shadow); margin-bottom: 14px; animation: fadeUp .5s ease-out both; }
.lobby-card:nth-child(4) { animation-delay: .08s; }
.lobby-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; }
.lobby-card p { color: #6a8fa8; font-size: .78rem; margin-bottom: 14px; }
.lobby-btn { width: 100%; padding: 14px; border: none; border-radius: 10px; font-family: 'Fredoka', sans-serif; font-size: 1.05rem; font-weight: 700; cursor: pointer; letter-spacing: 1px; transition: all .2s; }
.lobby-btn:hover { transform: translateY(-2px); }
.lobby-btn:active { transform: translateY(0); }
.lobby-btn.red { background: linear-gradient(135deg, #e63946, #c0392b); color: #fff; box-shadow: 0 4px 16px rgba(230,57,70,.3); }
.lobby-btn.red:hover { box-shadow: 0 6px 24px rgba(230,57,70,.4); }
.lobby-btn.blue { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.lobby-btn.blue:hover { background: var(--accent); color: #fff; }
.offline-btn { font-family: 'Fredoka', sans-serif; margin-top: 18px; padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 8px; background: transparent; color: #6a8fa8; font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .2s; letter-spacing: .5px; }
.offline-btn:hover { border-color: var(--accent); color: var(--cell-text); background: rgba(52,152,219,.08); }
.error-msg { background: rgba(230,57,70,.12); border: 1px solid #e63946; border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; color: #e63946; font-size: .82rem; font-weight: 600; display: none; }
.error-msg.show { display: block; }

/* ── Room Info Bar ── */
.room-bar { max-width: 920px; margin: 0 auto 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.room-bar-left { display: flex; align-items: center; gap: 12px; }
.room-code-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; }
.room-code-box .label { color: #6a8fa8; font-size: .78rem; }
.room-code-box .code { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--free-bg); font-size: 1.1rem; letter-spacing: 4px; }
.room-code-box .pcount { color: #2ecc71; font-size: .75rem; }
.room-bar-right { display: flex; align-items: center; gap: 8px; }
.patterns-btn, .become-host-btn, .leave-btn { padding: 6px 10px; border: 2px solid var(--accent); background: transparent; border-radius: 10px; cursor: pointer; font-size: 1rem; line-height: 1; transition: all .2s; }
.patterns-btn { color: var(--accent); border-color: var(--accent); }
.patterns-btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.leave-btn { color: #e63946; border-color: #e63946; }
.leave-btn:hover { background: #e63946; color: #fff; transform: translateY(-1px); }
.become-host-btn { color: #f1c40f; border-color: #f1c40f; }
.become-host-btn:hover { background: #f1c40f; color: #1a2733; transform: translateY(-1px); }

/* ── Players strip ── */
.players-strip { max-width: 920px; margin: 0 auto 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.player-tag { padding: 5px 14px; border-radius: 20px; font-size: .72rem; font-weight: 600; border: 1px solid var(--border); background: rgba(52,152,219,.08); color: var(--cell-text); transition: all .3s; }
.player-tag.me { border-color: var(--accent); }
.player-tag.winner { border-color: var(--free-bg); background: rgba(241,196,15,.15); color: var(--free-bg); animation: pulse 1s ease-in-out infinite; }
.player-tag.disconnected { opacity: .45; border-style: dashed; }
.make-host-btn { background: none; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: .6rem; padding: 1px 4px; margin-left: 2px; opacity: .5; transition: all .2s; line-height: 1; vertical-align: middle; }
.make-host-btn:hover { opacity: 1; border-color: var(--free-bg); background: rgba(241,196,15,.15); }
.kick-btn { background: none; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: .55rem; padding: 1px 4px; margin-left: 2px; opacity: .4; transition: all .2s; line-height: 1; vertical-align: middle; color: #e63946; }
.kick-btn:hover { opacity: 1; border-color: #e63946; background: rgba(230,57,70,.12); }

/* ── Winners banner ── */
.winners-banner { max-width: 920px; margin: 0 auto 14px; text-align: center; background: rgba(241,196,15,.08); border: 1px solid rgba(241,196,15,.25); border-radius: 14px; padding: 10px 18px; display: none; }
.winners-banner.show { display: block; animation: glow 2s ease-in-out infinite; }
.winners-banner span { font-size: .88rem; color: var(--free-bg); font-weight: 700; }
.view-winners-btn { font-family: 'Fredoka', sans-serif; padding: 4px 14px; border: 1.5px solid var(--free-bg); background: rgba(241,196,15,.15); color: var(--free-bg); border-radius: 8px; font-size: .75rem; font-weight: 600; cursor: pointer; transition: all .2s; margin-left: 8px; }
.view-winners-btn:hover { background: var(--free-bg); color: var(--free-text); transform: scale(1.05); }

/* ── Notification ── */
.bingo-notify { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); opacity: 0; pointer-events: none; transition: opacity .3s; }
.bingo-notify.show { opacity: 1; pointer-events: auto; }
.bingo-notify-box { background: var(--surface); border: 3px solid var(--free-bg); border-radius: 24px; padding: 40px 50px; text-align: center; transform: scale(0.5); transition: transform .4s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 0 60px rgba(241,196,15,0.4), 0 20px 60px rgba(0,0,0,0.5); max-width: 90vw; max-height: 90vh; overflow-y: auto; }
.bingo-notify.show .bingo-notify-box { transform: scale(1); }
.bingo-notify-box h2 { font-size: 3rem; font-weight: 700; color: var(--free-bg); letter-spacing: 6px; margin-bottom: 8px; text-shadow: 0 0 30px rgba(241,196,15,0.5); }
.bingo-notify-box .notify-card { font-size: 1.2rem; color: var(--cell-text); margin-bottom: 4px; }
.bingo-notify-box .notify-patterns { font-size: .9rem; color: var(--pattern-color); margin-bottom: 14px; }
.bingo-notify-box .notify-count { font-size: 1.1rem; font-weight: 700; color: #2ecc71; margin-bottom: 6px; display: none; }
.bingo-notify-box .notify-preview { margin-bottom: 14px; display: flex; justify-content: center; }
.notify-nav { display: none; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.notify-arrow { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--cell-bg); color: var(--cell-text); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; padding: 0; }
.notify-arrow:hover { border-color: var(--free-bg); color: var(--free-bg); background: rgba(241,196,15,.1); transform: scale(1.1); }
.notify-page { font-size: .85rem; color: #6a8fa8; font-weight: 600; min-width: 50px; text-align: center; }
.notify-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 200px; }
.notify-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .65rem; background: var(--cell-bg); color: var(--cell-text); }
.notify-cell.notify-header { background: var(--header-bg); color: var(--header-text); font-family: 'Fredoka', sans-serif; font-size: .7rem; letter-spacing: 1px; }
.notify-cell.notify-marked { background: var(--marked-bg); color: var(--marked-text); }
.notify-cell.notify-free { background: var(--free-bg); color: var(--free-text); font-size: .55rem; }
.notify-cell.notify-win { box-shadow: 0 0 8px rgba(241,196,15,.8); z-index: 1; }
.bingo-notify-box button { font-family: 'Fredoka', sans-serif; padding: 12px 36px; border: none; border-radius: 12px; background: var(--free-bg); color: var(--free-text); font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: transform .15s; }
.bingo-notify-box button:hover { transform: scale(1.05); }

/* ── Kicked Notification ── */
.kicked-notify { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.75); opacity: 0; pointer-events: none; transition: opacity .3s; }
.kicked-notify.show { opacity: 1; pointer-events: auto; }
.kicked-notify-box { background: var(--surface); border: 3px solid #e63946; border-radius: 24px; padding: 40px 50px; text-align: center; transform: scale(0.5); transition: transform .4s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 0 60px rgba(230,57,70,0.3), 0 20px 60px rgba(0,0,0,0.5); max-width: 90vw; }
.kicked-notify.show .kicked-notify-box { transform: scale(1); }
.kicked-notify-box .kicked-icon { font-size: 4rem; margin-bottom: 8px; }
.kicked-notify-box h2 { font-size: 1.8rem; font-weight: 700; color: #e63946; margin-bottom: 8px; }
.kicked-notify-box p { font-size: 1rem; color: #6a8fa8; margin-bottom: 20px; }
.kicked-notify-box button { font-family: 'Fredoka', sans-serif; padding: 12px 36px; border: none; border-radius: 12px; background: #e63946; color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: transform .15s; }
.kicked-notify-box button:hover { transform: scale(1.05); background: #c0313d; }

/* ── Styled Modal (alert/confirm replacement) ── */
.styled-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); opacity: 0; pointer-events: none; transition: opacity .3s; }
.styled-modal.show { opacity: 1; pointer-events: auto; }
.styled-modal-box { background: var(--surface); border: 3px solid #3498db; border-radius: 24px; padding: 36px 44px; text-align: center; transform: scale(0.5); transition: transform .4s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 0 50px rgba(0,0,0,0.4), 0 20px 60px rgba(0,0,0,0.4); max-width: 90vw; min-width: 280px; }
.styled-modal.show .styled-modal-box { transform: scale(1); }
.styled-modal-icon { font-size: 3.5rem; margin-bottom: 6px; }
.styled-modal-box h2 { font-size: 1.5rem; font-weight: 700; color: #3498db; margin-bottom: 8px; }
.styled-modal-box p { font-size: .95rem; color: #6a8fa8; margin-bottom: 22px; line-height: 1.5; }
.styled-modal-btns { display: flex; gap: 12px; justify-content: center; }
.styled-modal-confirm { font-family: 'Fredoka', sans-serif; padding: 11px 32px; border: none; border-radius: 12px; background: #3498db; color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform .15s, filter .15s; }
.styled-modal-confirm:hover { transform: scale(1.05); filter: brightness(1.1); }
.styled-modal-cancel { font-family: 'Fredoka', sans-serif; padding: 11px 32px; border: 2px solid var(--border); border-radius: 12px; background: transparent; color: #6a8fa8; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.styled-modal-cancel:hover { border-color: #6a8fa8; color: var(--cell-text); transform: scale(1.05); }

/* ── Winners Modal ── */
.winners-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9998; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); opacity: 0; pointer-events: none; transition: opacity .3s; }
.winners-modal.show { opacity: 1; pointer-events: auto; }
.winners-modal-box { background: var(--surface); border: 2px solid var(--free-bg); border-radius: 20px; padding: 24px; max-width: 90vw; max-height: 85vh; overflow-y: auto; min-width: 300px; box-shadow: 0 0 40px rgba(241,196,15,0.3), 0 20px 60px rgba(0,0,0,0.5); transform: scale(0.5); transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.winners-modal.show .winners-modal-box { transform: scale(1); }
.winners-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.winners-modal-header h2 { font-size: 1.3rem; color: var(--free-bg); letter-spacing: 2px; }
.winners-modal-close { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--cell-bg); color: #6a8fa8; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.winners-modal-close:hover { border-color: #e63946; color: #e63946; background: rgba(230,57,70,.1); }
.winners-modal-body { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.winners-modal-card { background: var(--cell-bg); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.winners-modal-card-title { font-size: .9rem; font-weight: 700; color: var(--free-bg); }
.winners-modal-card-patterns { font-size: .75rem; color: var(--pattern-color); margin-bottom: 4px; }

/* ── Patterns Modal ── */
.patterns-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9998; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); opacity: 0; pointer-events: none; transition: opacity .3s; }
.patterns-modal.show { opacity: 1; pointer-events: auto; }
.patterns-modal-box { background: var(--surface); border: 2px solid var(--accent); border-radius: 20px; padding: 24px; max-width: 90vw; max-height: 85vh; overflow-y: auto; min-width: 300px; width: 680px; box-shadow: 0 0 40px rgba(52,152,219,0.3), 0 20px 60px rgba(0,0,0,0.5); transform: scale(0.5); transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.patterns-modal.show .patterns-modal-box { transform: scale(1); }
.patterns-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.patterns-modal-header h2 { font-size: 1.3rem; color: var(--accent); letter-spacing: 1px; }
.patterns-modal-close { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--cell-bg); color: #6a8fa8; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.patterns-modal-close:hover { border-color: #e63946; color: #e63946; background: rgba(230,57,70,.1); }
.patterns-modal-body { display: flex; flex-direction: column; gap: 16px; }
.patterns-modal-section { display: flex; flex-direction: column; gap: 12px; }
.patterns-modal-hint { font-size: .8rem; color: #6a8fa8; text-align: center; line-height: 1.5; }
.patterns-modal-hint strong { color: var(--cell-text); }
.pattern-preview-card { background: var(--cell-bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 100px; }
.pattern-preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 80px; }
.pattern-preview-cell { width: 14px; height: 14px; border-radius: 3px; background: var(--border); transition: all .2s; }
.pattern-preview-cell.on { background: var(--accent); box-shadow: 0 0 6px rgba(52,152,219,.5); }
.pattern-preview-cell.free { background: var(--free-bg); }
.pattern-preview-cell.free.on { background: var(--free-bg); box-shadow: 0 0 6px rgba(241,196,15,.5); }
.pattern-preview-name { font-size: .8rem; font-weight: 700; color: var(--cell-text); }

.confetti-container { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 10px; top: -20px; animation: confettiFall 3s ease-in forwards; }

/* ── Caller ── */
.caller-section { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 100; background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.caller-section input { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; width: 80px; text-align: center; padding: 10px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--free-bg); outline: none; }
.caller-section input:focus { border-color: var(--free-bg); }
.call-btn { font-family: 'Fredoka', sans-serif; padding: 10px 24px; background: var(--free-bg); color: var(--free-text); border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.call-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(241,196,15,.3); }
.host-only { display: none; }
.is-host .host-only { display: flex; }
.is-host .host-only.hidden { display: none; }
.caller-section.fixed-keyboard { position: fixed; top: 0; left: 0; right: 0; padding: 12px 20px; box-shadow: 0 4px 20px rgba(0,0,0,.5); }

/* ── Raffle ── */
.raffle-section { max-width: 500px; margin: 0 auto 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--card-shadow); text-align: center; }
.raffle-section h3 { font-size: 1rem; color: #6a8fa8; font-weight: 600; margin-bottom: 16px; letter-spacing: 1px; text-transform: uppercase; }
.raffle-ball-area { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.raffle-ball { width: 110px; height: 110px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; position: relative; transition: all .4s; background: radial-gradient(circle at 35% 35%, #3a5f80, var(--cell-bg)); border: 3px solid var(--border); box-shadow: inset 0 -4px 12px rgba(0,0,0,.3), 0 4px 20px rgba(0,0,0,.3); }
.raffle-ball.active { border-color: var(--free-bg); box-shadow: inset 0 -4px 12px rgba(0,0,0,.3), 0 0 40px rgba(241,196,15,.4), 0 4px 20px rgba(0,0,0,.3); }
.raffle-ball .ball-letter { font-size: 1rem; color: var(--free-bg); letter-spacing: 2px; font-family: 'Fredoka', sans-serif; }
.raffle-ball .ball-number { font-size: 2.8rem; color: #fff; line-height: 1; }
.raffle-ball.empty .ball-letter { color: #4a6070; }
.raffle-ball.empty .ball-number { font-size: 1.2rem; color: #4a6070; }
.raffle-ball.spinning { animation: ballSpin .6s ease-in-out infinite; }
.raffle-ball.pop { animation: ballPop .4s ease-out; }
.raffle-controls { display: flex; justify-content: center; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.auto-draw-wrap { display: flex; flex-direction: column; align-items: center; }
.raffle-btn { font-family: 'Fredoka', sans-serif; padding: 14px 36px; background: linear-gradient(135deg, #e63946, #c0392b); color: #fff; border: none; border-radius: 14px; font-size: 1.15rem; font-weight: 700; cursor: pointer; transition: all .2s; letter-spacing: 1px; box-shadow: 0 4px 16px rgba(230,57,70,.3); }
.raffle-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(230,57,70,.4); }
.raffle-btn:active { transform: translateY(0); }
.raffle-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.raffle-btn.auto-draw-btn { background: linear-gradient(135deg, #2ecc71, #27ae60); box-shadow: 0 4px 16px rgba(46,204,113,.3); }
.raffle-btn.auto-draw-btn:hover { box-shadow: 0 6px 24px rgba(46,204,113,.4); }
.raffle-btn.auto-draw-btn.active { background: linear-gradient(135deg, #e67e22, #d35400); box-shadow: 0 4px 16px rgba(230,126,34,.3); animation: pulse 1.5s ease-in-out infinite; }
.auto-draw-speed { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 6px; }
.speed-btn { font-family: 'Fredoka', sans-serif; font-size: .68rem; padding: 4px 10px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--cell-bg); color: #6a8fa8; cursor: pointer; font-weight: 600; transition: all .15s; white-space: nowrap; }
.speed-btn:hover { border-color: var(--accent); color: var(--cell-text); }
.speed-btn.active { border-color: #2ecc71; background: rgba(46,204,113,.15); color: #2ecc71; }
.raffle-remaining { font-size: .8rem; color: #4a6070; margin-top: 10px; }

/* ── Caller View Modal (full-screen host draw mode) ── */
.caller-view-modal { display: none; position: fixed; inset: 0; z-index: 2000; background: var(--bg); flex-direction: column; overflow-y: auto; }
.caller-view-modal.show { display: flex; }
.caller-view-header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px; flex-shrink: 0; }
.caller-view-title { font-family: 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.caller-view-room { font-family: 'Fredoka', sans-serif; font-size: .85rem; color: #6a8fa8; letter-spacing: 2px; }
.caller-view-close { margin-left: auto; background: none; border: 2px solid #e63946; color: #e63946; border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: 1rem; line-height: 1; transition: all .2s; }
.caller-view-close:hover { background: #e63946; color: #fff; }
.caller-view-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 20px 16px; gap: 16px; }
.caller-view-ball-area { display: flex; justify-content: center; }
.caller-view-ball-area .raffle-ball { width: 140px; height: 140px; }
.caller-view-ball-area .ball-letter { font-size: 1.2rem; }
.caller-view-ball-area .ball-number { font-size: 3.5rem; }
.caller-view-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.caller-view-speed { display: flex; gap: 6px; justify-content: center; }
.caller-view-remaining { font-size: .85rem; color: #6a8fa8; }
.caller-view-called { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 600px; width: 100%; padding: 10px 0; }

/* ── Viewer Ball Toggle (Joiner's Last Called Section) ── */
.viewer-ball-toggle { cursor: pointer; user-select: none; }
.viewer-ball-content { max-height: 0; overflow: hidden; transition: max-height .3s; }
.viewer-ball-content.open { max-height: 300px; }

/* ── Called Numbers ── */
.called-header { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 8px; display: none; }
.called-header.show { display: flex; }
.called-header .called-label { font-size: .8rem; color: #6a8fa8; font-weight: 600; }
.sort-btn { font-family: 'Fredoka', sans-serif; font-size: .7rem; padding: 4px 10px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--cell-bg); color: #6a8fa8; cursor: pointer; font-weight: 600; transition: all .15s; }
.sort-btn:hover { border-color: var(--accent); color: var(--cell-text); }
.sort-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.called-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; max-width: 800px; margin-left: auto; margin-right: auto; min-height: 36px; }
.called-ball { width: 42px; height: 42px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .5rem; background: radial-gradient(circle at 35% 35%, #2a4a60, var(--cell-bg)); border: 2px solid var(--border); color: #6a8fa8; line-height: 1.1; position: relative; animation: popIn .2s ease-out; }
.called-ball .cb-num { font-size: .85rem; color: var(--cell-text); }
.called-ball .cb-order { position: absolute; bottom: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .5rem; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 1.5px solid var(--bg); }

/* ── Pattern Panel ── */
.pattern-panel { max-width: 920px; margin: 0 auto 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--card-shadow); }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; cursor: pointer; user-select: none; transition: background .2s; }
.panel-header:hover { background: rgba(255,255,255,.02); }
.panel-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--cell-text); display: flex; align-items: center; gap: 8px; }
.panel-header h2 .icon { font-size: 1.2rem; }
.panel-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.active-tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.active-tag { font-size: .7rem; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: rgba(230,126,34,.15); color: var(--pattern-color); white-space: nowrap; }
.active-tag.none { background: rgba(100,130,160,.15); color: #6a8fa8; }
.active-tag.more { background: rgba(230,126,34,.25); cursor: pointer; }
.arrow { font-size: .7rem; color: #6a8fa8; transition: transform .3s; }
.arrow.open { transform: rotate(180deg); }
.panel-body { max-height: 0; overflow: hidden; transition: max-height .4s ease, padding .3s; padding: 0 20px; }
.panel-body.open { max-height: 1100px; padding: 0 20px 20px; }
.pattern-hint { font-size: .8rem; color: #5a7a90; margin-bottom: 14px; line-height: 1.4; }
.pattern-hint strong { color: #6a8fa8; }
.presets-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.preset-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 8px; border: 2px solid var(--border); border-radius: 10px; background: var(--cell-bg); cursor: pointer; transition: all .2s; min-width: 82px; position: relative; }
.preset-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.preset-btn.active { border-color: var(--pattern-color); background: rgba(230,126,34,.1); }
.preset-btn .check-mark { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--pattern-color); color: #fff; font-size: .55rem; display: flex; align-items: center; justify-content: center; font-weight: 700; opacity: 0; transform: scale(0); transition: all .2s; }
.preset-btn.active .check-mark { opacity: 1; transform: scale(1); }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.mini-cell { width: 7px; height: 7px; border-radius: 1.5px; background: var(--border); }
.mini-cell.on { background: var(--pattern-color); }
.preset-name { font-size: .65rem; color: #6a8fa8; font-weight: 600; text-align: center; }
.preset-btn.active .preset-name { color: var(--pattern-color); }

/* ── Controls ── */
.controls { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.controls button { font-family: 'Fredoka', sans-serif; padding: 10px 18px; border: 2px solid var(--border); background: var(--surface); color: var(--cell-text); border-radius: 10px; cursor: pointer; font-size: .9rem; font-weight: 600; transition: all .2s; }
.controls button:hover { border-color: var(--accent); background: var(--cell-bg); transform: translateY(-1px); }
.controls .reset-btn { border-color: #e63946; color: #e63946; }
.controls .reset-btn:hover { background: #e63946; color: #fff; }
.controls .shuffle-btn { border-color: #9b59b6; color: #9b59b6; }
.controls .shuffle-btn:hover { background: #9b59b6; color: #fff; }

/* ── Card ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; max-width: 1400px; margin: 0 auto; }
.cards-grid.compact { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cards-grid.mini { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cards-grid.micro { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.bingo-card { background: var(--surface); border-radius: 16px; padding: 16px; box-shadow: var(--card-shadow); border: 1px solid var(--border); transition: border-color .3s, box-shadow .3s; }
.bingo-card.new-card { animation: cardAppear .4s ease-out; }
.bingo-card.winner { border-color: var(--free-bg); box-shadow: 0 0 30px rgba(241,196,15,.3), var(--card-shadow); }
.cards-grid.compact .bingo-card { padding: 12px; border-radius: 12px; }
.cards-grid.mini .bingo-card { padding: 8px; border-radius: 8px; }
.cards-grid.micro .bingo-card { padding: 5px; border-radius: 6px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 1.1rem; color: var(--cell-text); }
.cards-grid.compact .card-title { font-size: .95rem; }
.cards-grid.mini .card-title { font-size: .8rem; }
.cards-grid.micro .card-title { font-size: .6rem; }
.cards-grid.micro .card-header { margin-bottom: 4px; }
.card-header-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-badge { font-size: .75rem; padding: 3px 10px; border-radius: 20px; font-weight: 600; background: var(--cell-bg); color: #6a8fa8; transition: all .3s; }
.card-badge.bingo { background: var(--free-bg); color: var(--free-text); animation: pulse 1s ease-in-out infinite; }
.cards-grid.compact .card-badge { font-size: .65rem; padding: 2px 8px; }
.cards-grid.mini .card-badge { font-size: .55rem; padding: 1px 6px; }
.cards-grid.micro .card-badge { font-size: .4rem; padding: 1px 4px; }
.win-pattern-label { font-size: .65rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; background: rgba(46,204,113,.15); color: var(--marked-bg); margin-right: 2px; }
.cards-grid.compact .win-pattern-label { font-size: .55rem; padding: 1px 6px; }
.cards-grid.mini .win-pattern-label { font-size: .45rem; padding: 1px 4px; }
.cards-grid.micro .win-pattern-label { font-size: .35rem; padding: 1px 3px; }
.card-action-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--cell-bg); color: #6a8fa8; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .85rem; transition: all .15s; padding: 0; font-family: 'Fredoka', sans-serif; }
.card-action-btn:hover { transform: scale(1.1); }
.card-action-btn.shuffle-card:hover { border-color: #9b59b6; color: #9b59b6; }
.card-action-btn.remove-card { width: 24px; height: 24px; font-size: .75rem; }
.card-action-btn.remove-card:hover { border-color: #e63946; color: #e63946; }
.cards-grid.compact .card-action-btn { width: 24px; height: 24px; font-size: .75rem; }
.cards-grid.mini .card-action-btn { width: 20px; height: 20px; font-size: .65rem; }
.cards-grid.micro .card-action-btn { width: 16px; height: 16px; font-size: .5rem; border-radius: 4px; }
.cards-grid.micro .card-action-btn.remove-card { width: 16px; height: 16px; font-size: .5rem; }
.cards-grid.micro .card-header-right { gap: 3px; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cards-grid.compact .grid { gap: 3px; }
.cards-grid.mini .grid { gap: 2px; }
.cards-grid.micro .grid { gap: 1px; }
.cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.1rem; transition: all .15s; user-select: none; position: relative; }
.cards-grid.compact .cell { font-size: .9rem; border-radius: 6px; }
.cards-grid.mini .cell { font-size: .7rem; border-radius: 4px; }
.cards-grid.micro .cell { font-size: .5rem; border-radius: 3px; }
.cell.header-cell { background: var(--header-bg); color: var(--header-text); font-family: 'Fredoka', sans-serif; font-size: 1.2rem; cursor: default; letter-spacing: 1px; }
.cards-grid.compact .cell.header-cell { font-size: 1rem; }
.cards-grid.mini .cell.header-cell { font-size: .8rem; }
.cards-grid.micro .cell.header-cell { font-size: .5rem; letter-spacing: 0; }
.cell.number-cell { background: var(--cell-bg); color: var(--cell-text); }
.cell.number-cell.empty-cell { border: 1.5px dashed var(--border); background: rgba(52,152,219,.04); cursor: pointer; }
.cell.number-cell.empty-cell:hover { background: rgba(52,152,219,.12); border-color: var(--accent); }
.cell.number-cell:hover { background: var(--cell-hover); transform: scale(1.05); }
.cell.number-cell.marked { background: var(--marked-bg); color: var(--marked-text); transform: scale(1); }
.cell.number-cell.marked::after { content: ''; position: absolute; width: 60%; height: 60%; border-radius: 50%; border: 3px solid rgba(0,0,0,.2); pointer-events: none; }
.cards-grid.compact .cell.number-cell.marked::after { border-width: 2.5px; }
.cards-grid.mini .cell.number-cell.marked::after { border-width: 2px; width: 55%; height: 55%; }
.cards-grid.micro .cell.number-cell.marked::after { border-width: 1px; width: 50%; height: 50%; }
.cell.free-cell { background: var(--free-bg); color: var(--free-text); font-family: 'Fredoka', sans-serif; font-size: .7rem; font-weight: 700; letter-spacing: 1px; cursor: default; }
.cards-grid.micro .cell.free-cell { font-size: .3rem; letter-spacing: 0; }
.cell.win-line { box-shadow: 0 0 12px rgba(241,196,15,.6); z-index: 1; }
.cards-grid.compact .cell.win-line { box-shadow: 0 0 10px rgba(241,196,15,.5); }
.cards-grid.mini .cell.win-line { box-shadow: 0 0 8px rgba(241,196,15,.4); }
.cards-grid.micro .cell.win-line { box-shadow: 0 0 5px rgba(241,196,15,.3); }
.cell.number-cell.editing { padding: 0; overflow: visible; position: relative; }
.cell-edit-input { width: 100%; height: 100%; border: 2px solid var(--free-bg); border-radius: inherit; background: var(--surface); color: var(--free-bg); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: inherit; text-align: center; outline: none; box-shadow: 0 0 12px rgba(241,196,15,.3); -moz-appearance: textfield; }
.cell-edit-input::-webkit-outer-spin-button, .cell-edit-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell-edit-error { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); background: #e63946; color: #fff; font-size: .55rem; font-family: 'Fredoka', sans-serif; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; z-index: 10; pointer-events: none; animation: popIn .2s ease-out; }

/* ── Card Size Display & Dividers ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-label { display: block; font-size: .75rem; color: #6a8fa8; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 8px; }

/* ── Custom Pattern Editor (from single-player) ── */
.custom-area { max-width: 500px; margin: 0 auto 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--card-shadow); }
.custom-area h3 { font-size: .9rem; color: #6a8fa8; font-weight: 600; margin-bottom: 12px; letter-spacing: 1px; text-transform: uppercase; }
.custom-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 14px; }
.custom-cell { aspect-ratio: 1; border-radius: 6px; border: 2px solid var(--border); background: var(--cell-bg); cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #6a8fa8; font-size: .7rem; }
.custom-cell:hover { border-color: var(--accent); }
.custom-cell.on { background: var(--pattern-color); color: #fff; border-color: var(--pattern-color); }
.custom-btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.custom-btn { font-family: 'Fredoka', sans-serif; padding: 8px 14px; border: 2px solid var(--border); background: var(--cell-bg); color: #6a8fa8; border-radius: 8px; cursor: pointer; font-size: .75rem; font-weight: 600; transition: all .2s; }
.custom-btn:hover { border-color: var(--accent); color: var(--cell-text); }
.custom-btn.apply { border-color: var(--free-bg); color: var(--free-bg); }
.custom-btn.apply:hover { background: var(--free-bg); color: var(--free-text); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 40px 20px; color: #6a8fa8; }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; color: var(--cell-text); }
.empty-state-text { font-size: .85rem; margin-bottom: 14px; }
.empty-state-btn { font-family: 'Fredoka', sans-serif; padding: 10px 20px; background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; transition: all .2s; }
.empty-state-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(52,152,219,.3); }

/* ── Card Count & Controls ── */
.card-count { font-size: .75rem; color: #6a8fa8; font-weight: 600; }
.size-toggle { display: flex; gap: 4px; }
.size-toggle button { font-family: 'Fredoka', sans-serif; font-size: .65rem; padding: 4px 10px; border: 1.5px solid var(--border); background: var(--cell-bg); color: #6a8fa8; border-radius: 6px; cursor: pointer; transition: all .15s; }
.size-toggle button:hover { border-color: var(--accent); }
.size-toggle button.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── Raffle Toggle ── */
.raffle-toggle { font-family: 'Fredoka', sans-serif; padding: 8px 16px; border: 2px solid var(--border); background: var(--surface); color: var(--cell-text); border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .2s; }
.raffle-toggle:hover { border-color: var(--accent); background: var(--cell-bg); }
.raffle-toggle.active { border-color: var(--free-bg); color: var(--free-bg); }
.quick-draw-btn { font-family: 'Fredoka', sans-serif; padding: 8px 16px; border: 2px solid #e63946; background: var(--surface); color: #e63946; border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .2s; }
.quick-draw-btn:hover { background: #e63946; color: #fff; }
.quick-auto-btn { font-family: 'Fredoka', sans-serif; padding: 8px 16px; border: 2px solid #2ecc71; background: var(--surface); color: #2ecc71; border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .2s; }
.quick-auto-btn:hover { background: #2ecc71; color: #fff; }
.quick-auto-btn.active { background: linear-gradient(135deg, #e67e22, #d35400); color: #fff; border-color: #d35400; animation: pulse 1.5s ease-in-out infinite; }
.reset-toggle { font-family: 'Fredoka', sans-serif; padding: 8px 16px; border: none; background: #e63946; color: #fff; border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .2s; }
.reset-toggle:hover { background: #c0392b; transform: translateY(-1px); }
.caller-view-btn { font-family: 'Fredoka', sans-serif; padding: 8px 14px; border: 2px solid var(--accent); background: transparent; color: var(--accent); border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 600; transition: all .2s; }
.caller-view-btn:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.raffle-section.hidden { display: none; }

/* ── Gen Button (Add Card) ── */
.gen-btn { font-family: 'Fredoka', sans-serif; padding: 10px 20px; background: linear-gradient(135deg, #9b59b6, #8e44ad); color: #fff; border: none; border-radius: 10px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: all .2s; }
.gen-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(155,89,182,.3); }
.gen-btn:active { transform: translateY(0); }

/* ── Stats and Footer ── */
.stats { text-align: center; margin-top: 28px; color: #6a8fa8; font-size: .85rem; padding-bottom: 10px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 8px; }
  .top-bar { margin-bottom: 10px; }
  .top-bar h1 { font-size: 1.3rem; }
  .top-bar p { font-size: .7rem; margin-top: 2px; }
  .lobby-title { font-size: 1.4rem; }
  .lobby-ball { width: 36px; height: 36px; font-size: .95rem; }
  .lobby-card { padding: 16px; }
  .room-bar { gap: 6px; margin-bottom: 8px; }
  .room-code-box { padding: 6px 10px; }
  .room-code-box .code { font-size: .9rem; letter-spacing: 3px; }
  .patterns-btn, .become-host-btn, .leave-btn { padding: 5px 8px; font-size: .9rem; }
  .patterns-modal-box { padding: 16px; border-radius: 14px; min-width: 240px; }
  .patterns-modal-header h2 { font-size: 1rem; }
  .pattern-preview-card { padding: 10px; border-radius: 10px; min-width: 80px; }
  .pattern-preview-grid { width: 60px; gap: 2px; }
  .pattern-preview-cell { width: 10px; height: 10px; border-radius: 2px; }
  .pattern-preview-name { font-size: .65rem; }
  .players-strip { gap: 5px; margin-bottom: 8px; }
  .player-tag { font-size: .6rem; padding: 3px 10px; }
  .winners-banner { padding: 8px 12px; margin-bottom: 8px; }
  .winners-banner span { font-size: .75rem; }
  .caller-section { gap: 6px; margin-bottom: 8px; padding: 8px 0; }
  .caller-section input { width: 60px; padding: 8px 4px; font-size: 1.1rem; border-radius: 8px; }
  .call-btn { padding: 8px 14px; font-size: .8rem; border-radius: 8px; }
  .raffle-section { padding: 14px 10px; margin-bottom: 12px; border-radius: 14px; }
  .raffle-section h3 { font-size: .75rem; margin-bottom: 8px; }
  .raffle-ball { width: 80px; height: 80px; }
  .raffle-ball .ball-letter { font-size: .8rem; }
  .raffle-ball .ball-number { font-size: 2rem; }
  .raffle-btn { padding: 10px 24px; font-size: .9rem; border-radius: 10px; }
  .auto-draw-speed { gap: 3px; margin-top: 4px; }
  .speed-btn { font-size: .58rem; padding: 3px 7px; }
  .raffle-remaining { font-size: .65rem; margin-top: 6px; }
  .called-numbers { gap: 4px; margin-bottom: 12px; }
  .called-ball { width: 32px; height: 32px; font-size: .4rem; }
  .called-ball .cb-num { font-size: .6rem; }
  .called-ball .cb-order { width: 12px; height: 12px; font-size: .4rem; }
  .pattern-panel { margin-bottom: 10px; border-radius: 10px; }
  .panel-header { padding: 10px 12px; }
  .panel-header h2 { font-size: .85rem; }
  .active-tag { font-size: .55rem; padding: 2px 6px; }
  .panel-body.open { max-height: 2000px; padding: 0 12px 12px; }
  .presets-grid { gap: 6px; margin-bottom: 10px; }
  .preset-btn { min-width: 60px; padding: 6px 6px 5px; border-radius: 6px; }
  .mini-cell { width: 5px; height: 5px; }
  .preset-name { font-size: .5rem; }
  .controls { gap: 5px; margin-bottom: 8px; }
  .controls button { padding: 7px 10px; font-size: .7rem; border-radius: 7px; }
  .cards-grid { gap: 10px; }
  .cards-grid.compact { gap: 8px; }
  .cards-grid.mini { gap: 6px; }
  .cards-grid.micro { gap: 4px; }
  .bingo-card { padding: 10px; border-radius: 10px; }
  .cards-grid.compact .bingo-card { padding: 8px; border-radius: 8px; }
  .cards-grid.mini .bingo-card { padding: 6px; border-radius: 6px; }
  .cards-grid.micro .bingo-card { padding: 4px; border-radius: 4px; }
  .card-header { margin-bottom: 6px; }
  .card-title { font-size: .9rem; }
  .cards-grid.compact .card-title { font-size: .75rem; }
  .cards-grid.mini .card-title { font-size: .65rem; }
  .cards-grid.micro .card-title { font-size: .5rem; }
  .cell { font-size: .9rem; border-radius: 6px; }
  .cards-grid.compact .cell { font-size: .75rem; border-radius: 5px; }
  .cards-grid.mini .cell { font-size: .55rem; border-radius: 3px; }
  .cards-grid.micro .cell { font-size: .4rem; border-radius: 2px; }
  .cell.header-cell { font-size: .9rem; }
  .cards-grid.compact .cell.header-cell { font-size: .75rem; }
  .cards-grid.mini .cell.header-cell { font-size: .6rem; }
  .cards-grid.micro .cell.header-cell { font-size: .4rem; }
  .cell.free-cell { font-size: .55rem; }
  .cards-grid.compact .cell.free-cell { font-size: .45rem; }
  .cards-grid.mini .cell.free-cell { font-size: .35rem; }
  .cards-grid.micro .cell.free-cell { font-size: .25rem; }
  .cell-edit-error { font-size: .45rem; bottom: -18px; padding: 1px 6px; }
  .custom-area { padding: 14px; margin-bottom: 12px; border-radius: 10px; }
  .custom-area h3 { font-size: .75rem; margin-bottom: 10px; }
  .custom-grid { gap: 3px; margin-bottom: 12px; }
  .custom-cell { border-radius: 4px; font-size: .6rem; }
  .custom-btns { gap: 6px; }
  .custom-btn { padding: 6px 12px; font-size: .65rem; border-radius: 6px; }
  .empty-state { padding: 30px 12px; }
  .empty-state-icon { font-size: 2.5rem; }
  .empty-state-title { font-size: .95rem; }
  .empty-state-text { font-size: .75rem; }
  .empty-state-btn { padding: 8px 16px; font-size: .8rem; border-radius: 8px; }
  .card-count { font-size: .65rem; }
  .size-toggle { gap: 3px; }
  .size-toggle button { font-size: .55rem; padding: 3px 8px; border-radius: 4px; }
  .raffle-toggle { padding: 6px 12px; font-size: .75rem; border-radius: 8px; }
  .quick-draw-btn { padding: 6px 12px; font-size: .75rem; border-radius: 8px; }
  .quick-auto-btn { padding: 6px 12px; font-size: .75rem; border-radius: 8px; }
  .reset-toggle { padding: 6px 12px; font-size: .75rem; border-radius: 8px; }
  .gen-btn { padding: 8px 16px; font-size: .8rem; border-radius: 8px; }
  .stats { font-size: .7rem; margin-top: 16px; }
  .divider { margin: 12px 0; }
  .section-label { font-size: .65rem; margin: 12px 0 6px; }
  .bingo-notify-box { padding: 24px 20px; border-radius: 18px; }
  .bingo-notify-box h2 { font-size: 2rem; letter-spacing: 3px; }
  .bingo-notify-box .notify-card { font-size: 1rem; }
  .bingo-notify-box .notify-patterns { font-size: .75rem; }
  .notify-grid { width: 160px; gap: 2px; }
  .notify-cell { font-size: .55rem; border-radius: 3px; }
  .notify-cell.notify-header { font-size: .55rem; }
  .notify-cell.notify-free { font-size: .45rem; }
  .notify-arrow { width: 32px; height: 32px; font-size: .85rem; }
  .notify-page { font-size: .7rem; }
  .bingo-notify-box .notify-count { font-size: .9rem; }
  .kicked-notify-box { padding: 24px 20px; border-radius: 18px; }
  .kicked-notify-box .kicked-icon { font-size: 3rem; }
  .kicked-notify-box h2 { font-size: 1.4rem; }
  .kicked-notify-box p { font-size: .85rem; }
  .styled-modal-box { padding: 24px 20px; border-radius: 18px; min-width: 240px; }
  .styled-modal-icon { font-size: 2.8rem; }
  .styled-modal-box h2 { font-size: 1.2rem; }
  .styled-modal-box p { font-size: .85rem; }
  .styled-modal-confirm, .styled-modal-cancel { padding: 10px 24px; font-size: .9rem; }
  .view-winners-btn { padding: 3px 10px; font-size: .65rem; margin-left: 6px; }
  .winners-modal-box { padding: 16px; border-radius: 14px; }
  .winners-modal-header h2 { font-size: 1rem; }
  .winners-modal-card { padding: 12px; border-radius: 10px; }
  .winners-modal-card-title { font-size: .75rem; }
  .winners-modal-card-patterns { font-size: .65rem; }
}
