@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=DM+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #191632;
  --purple: #7047eb;
  --purple-dark: #5531d6;
  --purple-light: #ece7fe;
  --paper: #faf8ff;
  --muted: #7c7490;
  --line: #e6e0f0;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fca5a5;
  --radius: 14px;
}

/* İçerik, sosyal ve moderasyon geliştirmeleri */
.quick-settings select,
.quick-settings input,
.join-password {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line, #e4def2);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  color: #27203d;
  font: inherit;
  box-sizing: border-box;
}

.quick-settings label small { font-weight: 500; opacity: .65; text-transform: none; }
.join-password { margin-bottom: 10px; text-align: center; letter-spacing: .04em; }

.player-avatar,
.profile-preview i,
.friend-list i,
.ranking-list i {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  background: var(--avatar, #7047eb);
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.player-avatar { width: 10px; height: 10px; flex-basis: 10px; }
.player-actions { display: flex; align-items: center; gap: 7px; }
.kick-player {
  width: 23px; height: 23px; border: 0; border-radius: 7px;
  background: #fee2e2; color: #b91c1c; font-size: 18px; line-height: 1; cursor: pointer;
}

.social-launch {
  position: fixed; right: 22px; top: 18px; z-index: 80;
  border: 1px solid #ded6f3; border-radius: 999px; background: rgba(255,255,255,.94);
  color: #43386a; padding: 9px 15px; box-shadow: 0 7px 25px rgba(56,38,112,.12);
  font-weight: 800; cursor: pointer; backdrop-filter: blur(10px);
}

.social-modal {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(25,18,48,.46); padding: 18px; backdrop-filter: blur(5px);
}
.social-modal.show { display: grid; }
.social-card {
  position: relative; width: min(520px, 100%); max-height: min(690px, 90vh); overflow: auto;
  border-radius: 22px; background: #fff; padding: 22px; box-shadow: 0 30px 80px rgba(24,15,56,.3);
}
.social-close { position: absolute; right: 12px; top: 9px; border: 0; background: transparent; color: #766c91; font-size: 27px; cursor: pointer; }
.social-tabs { display: flex; gap: 6px; padding-right: 28px; margin-bottom: 20px; }
.social-tabs button { flex: 1; border: 0; border-radius: 10px; padding: 10px 6px; background: #f4f1fb; color: #71668b; font-weight: 800; cursor: pointer; }
.social-tabs button.active { background: #7047eb; color: #fff; }
.social-content { min-height: 270px; }
.social-content > label { display: block; margin: 14px 0 6px; color: #706582; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.social-content input { width: 100%; height: 43px; box-sizing: border-box; border: 1px solid #ded8eb; border-radius: 10px; padding: 0 12px; font: inherit; }
.social-primary, .social-row button, .friend-list button { border: 0; border-radius: 10px; background: #7047eb; color: #fff; padding: 11px 15px; font-weight: 800; cursor: pointer; }
.social-primary { width: 100%; margin-top: 14px; }
.social-row { display: flex; gap: 8px; }
.social-row input { flex: 1; }
.profile-preview { display: flex; align-items: center; gap: 13px; padding: 13px; border-radius: 14px; background: #f7f4ff; }
.profile-preview i { width: 48px; height: 48px; flex-basis: 48px; font-size: 20px; }
.profile-preview div, .friend-list span { display: flex; flex-direction: column; gap: 3px; }
.profile-preview small, .friend-list small, .ranking-list small { color: #8c829d; }
.avatar-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-colors button { width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50%; background: var(--avatar); box-shadow: 0 0 0 1px #ddd5ec; cursor: pointer; }
.avatar-colors button.active { box-shadow: 0 0 0 3px #7047eb; }
.social-content hr { border: 0; border-top: 1px solid #eee9f5; margin: 20px 0; }
.friend-list, .ranking-list { display: grid; gap: 8px; margin-top: 16px; }
.friend-list > div, .ranking-list > div { display: flex; align-items: center; gap: 10px; border: 1px solid #eee9f5; border-radius: 12px; padding: 10px; }
.friend-list span { flex: 1; }
.friend-list .friend-block { width: 28px; height: 28px; padding: 0; background: #fee2e2; color: #b91c1c; }
.ranking-list em { width: 24px; color: #8b80a2; font-style: normal; font-weight: 900; text-align: center; }
.ranking-list b { flex: 1; }
.ranking-list span { display: flex; flex-direction: column; align-items: flex-end; color: #7047eb; font-weight: 900; }
.social-empty, .social-loading { text-align: center; color: #8b819c; padding: 55px 10px; }

.reaction-bar {
  position: fixed; left: 50%; bottom: 17px; z-index: 70; transform: translateX(-50%);
  display: none; gap: 4px; padding: 5px; background: rgba(255,255,255,.92);
  border: 1px solid #e1daf0; border-radius: 999px; box-shadow: 0 8px 25px rgba(40,27,80,.15);
}
#game.active .reaction-bar { display: flex; }
.reaction-bar button { width: 35px; height: 35px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; cursor: pointer; transition: .15s transform, .15s background; }
.reaction-bar button:hover { transform: translateY(-4px) scale(1.15); background: #f1edff; }
.reaction-layer { position: fixed; inset: 0; z-index: 190; pointer-events: none; overflow: hidden; }
.reaction-pop { position: absolute; bottom: 40px; display: flex; flex-direction: column; align-items: center; animation: reactionFloat 2.45s cubic-bezier(.18,.72,.22,1) forwards; }
.reaction-pop b { font-size: 42px; filter: drop-shadow(0 5px 8px rgba(40,20,80,.2)); }
.reaction-pop small { background: #fff; border-radius: 999px; padding: 3px 8px; color: #55486c; font-weight: 800; }
.reaction-pop.is-combo { animation-name: reactionFloatCombo; }
.reaction-pop.is-combo b { animation: reactionComboBump .32s cubic-bezier(.2,.85,.25,1); }
.reaction-pop.is-combo small { background: #7047eb; color: #fff; }
@keyframes reactionFloat {
  0% { opacity: 0; transform: translate(0,20px) scale(.68) rotate(0); }
  14% { opacity: 1; }
  48% { transform: translate(var(--reaction-mid-drift), var(--reaction-mid-rise)) scale(1.04) rotate(0); }
  100% { opacity: 0; transform: translate(var(--reaction-drift), var(--reaction-rise)) scale(1.22) rotate(var(--reaction-spin)); }
}
@keyframes reactionFloatCombo {
  0% { opacity: 0; transform: translate(0,20px) scale(.78) rotate(0); }
  14% { opacity: 1; }
  48% { transform: translate(var(--reaction-mid-drift), var(--reaction-mid-rise)) scale(1.1) rotate(0); }
  100% { opacity: 0; transform: translate(var(--reaction-drift), var(--reaction-rise)) scale(1.3) rotate(var(--reaction-spin)); }
}
@keyframes reactionComboBump { 50% { transform: scale(1.38) rotate(-7deg); } }

@media (max-width: 680px) {
  .social-launch { right: 10px; top: 10px; padding: 8px 10px; }
  .social-launch span { display: none; }
  .social-card { padding: 17px; border-radius: 17px; }
  .reaction-bar { bottom: 7px; }
  .reaction-bar button { width: 31px; height: 31px; font-size: 18px; }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at 15% 0, #eee5ff 0, transparent 28rem), var(--paper);
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
  height: 38px;
}

.logo {
  font-size: 23px;
  letter-spacing: -1.2px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}

.logo:before {
  content: 'm';
  font-style: italic;
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: var(--purple);
  color: #fff;
  border-radius: 8px;
  margin-right: 6px;
  transform: rotate(-6deg);
  box-shadow: 0 4px 10px rgba(112, 71, 235, 0.25);
}

.logo span {
  color: var(--purple);
  font-size: 14px;
  margin-left: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.target-pill, .timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 4px 11px;
  border-radius: 20px;
  font: 600 12.5px 'DM Mono', monospace;
  color: #4b445c;
  transition: all .2s;
}

.target-pill {
  color: var(--purple);
  border-color: #ded6fa;
  background: var(--purple-light);
}

.timer-pill.urgent {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
  animation: pulse-timer .7s infinite alternate;
}
.timer-pill.warning { border-color: #f5c451; background: #fff9e8; color: #b76a08; }
.timer-ring { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; }
.timer-ring svg { width: 18px; height: 18px; overflow: visible; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 2.6; }
.timer-ring-track { stroke: currentColor; opacity: .14; }
.timer-ring-progress {
  stroke: #7047eb; stroke-linecap: round;
  stroke-dasharray: 59.7; stroke-dashoffset: 59.7;
  transition: stroke-dashoffset .45s linear, stroke .25s;
}
.timer-pill.warning .timer-ring-progress { stroke: #f59e0b; }
.timer-pill.urgent .timer-ring-progress { stroke: #ef4444; }

@keyframes pulse-timer {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.online {
  font: 600 11px 'DM Mono', monospace;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* Screens */
.screen {
  display: none;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* Home Screen */
#home {
  text-align: center;
  padding: 30px 0;
  justify-content: center;
  align-items: center;
}

.eyebrow {
  font: 600 11px 'DM Mono', monospace;
  letter-spacing: .14em;
  color: #8d859c;
  margin-bottom: 6px;
}

#home h1 {
  margin: 6px 0 12px;
  font-size: 52px;
  line-height: .96;
  letter-spacing: -2px;
}

#home h1 em {
  font-style: normal;
  color: var(--purple);
}

.lead {
  max-width: 440px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.lobby {
  margin: auto;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 20px 50px rgba(29, 20, 59, 0.06);
  border-radius: 20px;
  padding: 22px;
  width: min(100%, 390px);
  text-align: left;
}

.lobby label {
  font: 600 11px 'DM Mono', monospace;
  letter-spacing: .08em;
  color: #7b738c;
  display: block;
}

.lobby input {
  display: block;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  margin: 6px 0 12px;
  padding: 10px 14px;
  outline-color: var(--purple);
  font: 600 15.5px Outfit, sans-serif;
}

/* Score Selector Pills */
.score-picker-wrap {
  margin-bottom: 14px;
}

.score-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.score-pill {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 4px;
  font: 700 12px 'DM Mono', monospace;
  color: #58506d;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}

.score-pill:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.score-pill.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 3px 8px rgba(112, 71, 235, 0.3);
}

.quick-settings { margin: 0 0 14px; }
.quick-settings label { font: 600 11px 'DM Mono', monospace; letter-spacing: .08em; color: #7b738c; display: block; margin: 8px 0 5px; }
.quick-settings div { display: flex; gap: 6px; }
.quick-settings button { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 4px; font: 700 12px 'DM Mono', monospace; cursor: pointer; color: #58506d; }
.quick-settings button.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.word-picker { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(26,20,48,.55); align-items: center; justify-content: center; padding: 18px; }
.word-picker.show { display: flex; }
.word-picker-card { width: min(100%, 390px); background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.24); text-align: center; }
.word-picker-card b { display: block; font-size: 20px; }
.word-picker-card small { display: block; margin: 6px 0 16px; color: var(--muted); }
.word-picker-card button { width: 100%; margin-top: 8px; border: 1.5px solid #ded4fc; background: #f8f6ff; border-radius: 10px; padding: 12px; color: var(--purple); font-weight: 800; font-size: 15px; cursor: pointer; }
.word-picker-card button:hover { background: var(--purple); color: #fff; }

.primary {
  width: 100%;
  border: 0;
  background: var(--purple);
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
}

.primary:hover {
  background: var(--purple-dark);
}

.divider {
  text-align: center;
  color: #a59eae;
  font-size: 12px;
  margin: 12px 0;
}

.join {
  display: flex;
  gap: 8px;
}

.join input {
  margin: 0;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 700;
}

.join button, .btn-sm {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 0 13px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  min-height: 38px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}

.join button:hover, .btn-sm:hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* Game Top Controls */
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px;
  gap: 8px;
  flex-shrink: 0;
  height: 42px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-pill {
  border-radius: 20px;
  background: var(--purple-light);
  color: #5531d6;
  padding: 4px 10px;
  font: 600 12px 'DM Mono', monospace;
  letter-spacing: .06em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.room-pill b {
  font-size: 13px;
}

.room-pill button {
  margin-left: 2px;
  padding: 3px 5px;
  color: #5531d6;
  background: #fff;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.turn-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Main Game Layout (DESKTOP) */
.game-layout {
  display: grid;
  grid-template-columns: 210px 1fr 300px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 110px);
  max-height: 800px;
  box-shadow: 0 16px 45px rgba(28, 25, 50, 0.05);
}

/* Sidebar: Players */
.players-sidebar {
  border-right: 1.5px solid var(--line);
  padding: 14px 12px;
  background: #fdfcff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sidebar-head h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0;
  font-family: 'DM Mono', monospace;
}

.count-badge {
  font: 600 11px 'DM Mono', monospace;
  background: var(--purple-light);
  color: var(--purple);
  padding: 2px 6px;
  border-radius: 10px;
}

.players-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.players-list li {
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.players-list li .player-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8a2b4;
  box-shadow: 0 0 0 2px #fff;
  flex: 0 0 auto;
}

.players-list li.is-online .player-status {
  background: var(--green);
}

.players-list li.is-offline {
  opacity: .58;
}

.players-list li.is-drawer {
  border-color: var(--purple);
  background: #f8f6ff;
}

.players-list li.has-guessed {
  border-color: var(--green-border);
  background: var(--green-bg);
}

.players-list li b {
  color: var(--purple);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: var(--purple-light);
  padding: 2px 6px;
  border-radius: 5px;
}

.btn-invite {
  background: var(--purple-light);
  border-color: #d8cefb;
  color: var(--purple);
}

.btn-invite:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.share-box {
  margin-top: 10px;
  flex-shrink: 0;
}

.btn-share-card {
  width: 100%;
  border: 1.5px solid #ded4fc;
  background: var(--purple-light);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #5531d6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
}

.btn-share-card:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* Draw Board (Canvas area) */
.draw-board {
  padding: 12px;
  background: #f7f5fb;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.draw-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 0 4px;
  flex-shrink: 0;
}

.title-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.role-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  background: #ede8ff;
  color: #6038db;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.secret-word {
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-clear {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s;
}

.btn-clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Gartic.io Style Drawing Toolbar */
.draw-toolbar {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 6px 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(27, 23, 52, 0.03);
}

#game.is-drawer-turn .draw-toolbar {
  display: flex;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-tool {
  border: 1.5px solid var(--line);
  background: #f8f6fc;
  border-radius: 7px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b445c;
  cursor: pointer;
  transition: all .15s;
  padding: 0;
}

.btn-tool:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: #fff;
}

.btn-tool.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 2px 6px rgba(112, 71, 235, 0.35);
}

/* Size buttons */
.sizes-selector {
  background: #f8f6fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 4px;
}

.btn-size {
  border: 0;
  background: transparent;
  width: 24px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 5px;
  padding: 0;
}

.btn-size.active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.dot-sm, .dot-md, .dot-lg, .dot-xl {
  display: inline-block;
  background: #201a38;
  border-radius: 50%;
}

.dot-sm { width: 4px; height: 4px; }
.dot-md { width: 7px; height: 7px; }
.dot-lg { width: 11px; height: 11px; }
.dot-xl { width: 15px; height: 15px; }

/* Color Palette */
.color-palette {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.color-palette::-webkit-scrollbar {
  display: none;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  outline: 1.5px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s, outline-color .15s;
  padding: 0;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  outline: 2.5px solid var(--purple);
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.draw-board canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none !important;
  cursor: crosshair;
}

/* Chat & Guess Panel */
.guess-panel {
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--line);
  background: #fff;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.panel-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.panel-header .eyebrow {
  margin: 0;
}

.panel-header #hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hint-label { color: var(--muted); }
.hint-letters { display: inline-flex; align-items: center; gap: 2px; perspective: 240px; }
.hint-letters i {
  display: inline-grid; place-items: center; min-width: 8px;
  color: var(--ink); font-style: normal; font-family: 'DM Mono', monospace; font-weight: 800;
}
.hint-letters i.is-hidden { color: #aaa0ba; }
.hint-letters i.is-new { animation: hintLetterReveal .58s cubic-bezier(.2,.85,.25,1) both; }
@keyframes hintLetterReveal {
  0% { opacity: 0; transform: rotateX(90deg) translateY(5px); filter: blur(5px); }
  65% { opacity: 1; transform: rotateX(-10deg) translateY(-1px); filter: blur(0); }
  100% { transform: none; }
}

.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fbfaff;
}

.chat-msg {
  font-size: 13px;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 8px;
  word-break: break-word;
}
.chat-msg.is-new { animation: chatMessageIn .42s cubic-bezier(.18,.85,.25,1); }
@keyframes chatMessageIn {
  0% { opacity: 0; transform: translateY(10px) scale(.97); }
  68% { opacity: 1; transform: translateY(-2px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

.chat-msg.guess {
  background: #fff;
  border: 1px solid var(--line);
}

.chat-msg.guess .sender {
  font-weight: 700;
  color: #3b3353;
  margin-right: 4px;
}

.chat-msg.correct {
  background: var(--green-bg);
  border: 1.5px solid var(--green-border);
  color: #065f46;
  font-weight: 700;
  text-align: center;
  padding: 7px 9px;
}

.chat-msg.close {
  background: var(--amber-bg);
  border: 1.5px solid var(--amber-border);
  color: #92400e;
  font-weight: 600;
}

.chat-msg.close .badge {
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  padding: 2px 5px;
  border-radius: 4px;
  margin-right: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chat-msg.close { position: relative; overflow: hidden; }
.chat-msg.close::before {
  content: '';
  position: absolute; inset: -2px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 12%, rgba(251,191,36,.3) 42%, rgba(249,115,22,.5) 52%, transparent 74%);
  opacity: 0; transform: translateX(-80%);
}
.chat-msg.close.is-hot { animation: closeGuessWarm .72s ease-out; }
.chat-msg.close.is-new.is-hot { animation: chatMessageIn .42s cubic-bezier(.18,.85,.25,1), closeGuessWarm .72s ease-out; }
.chat-msg.close.is-hot::before,
.chat-msg.close.is-hotter::before { animation: closeGuessShine .72s ease-out; }
.chat-msg.close.is-hotter {
  animation: closeGuessHotter .9s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 0 1px rgba(249,115,22,.25), 0 8px 22px rgba(249,115,22,.2);
}
.chat-msg.close.is-new.is-hotter { animation: chatMessageIn .42s cubic-bezier(.18,.85,.25,1), closeGuessHotter .9s cubic-bezier(.2,.8,.2,1); }
.chat-msg.close.is-hotter::after {
  content: '🔥';
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  animation: closeGuessFlame .9s ease-out both;
}
@keyframes closeGuessWarm {
  0% { background: #fff7df; scale: .98; }
  42% { background: #fde68a; scale: 1.015; }
  100% { background: var(--amber-bg); scale: 1; }
}
@keyframes closeGuessHotter {
  0% { background: #fff7df; scale: .97; }
  38% { background: #fdba74; scale: 1.025; }
  72% { background: #fde68a; }
  100% { background: var(--amber-bg); scale: 1; }
}
@keyframes closeGuessShine {
  0% { opacity: 0; transform: translateX(-80%); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: translateX(90%); }
}
@keyframes closeGuessFlame {
  0% { opacity: 0; translate: 0 7px; scale: .4; }
  35% { opacity: 1; translate: 0 -2px; scale: 1.2; }
  100% { opacity: 0; translate: 0 -13px; scale: .75; }
}
.close-heat-particle {
  position: fixed; z-index: 2501; pointer-events: none;
  font-style: normal; font-size: 17px; line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(249,115,22,.25));
}

.chat-msg.system {
  background: #f3f1f7;
  color: #635c75;
  font-size: 11px;
  text-align: center;
  font-family: 'DM Mono', monospace;
  padding: 4px 7px;
}

.chat-msg.drawer {
  background: var(--purple-light);
  border: 1px solid #dcd2ff;
  color: #432b9b;
}

.chat-msg.drawer .sender {
  font-weight: 700;
  color: var(--purple);
}

.chat-msg.game_over {
  background: #fef3c7;
  border: 1.5px solid #fcd34d;
  color: #92400e;
  font-weight: 700;
  text-align: center;
  padding: 9px;
  font-size: 13.5px;
}

.guess-form {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.guess-input-wrap {
  display: flex;
  gap: 6px;
}

.guess-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  outline-color: var(--purple);
  font: 600 15px Outfit, sans-serif;
  height: 38px;
}

.guess-input-wrap button {
  border: 0;
  border-radius: 8px;
  background: var(--purple);
  color: #fff;
  padding: 0 14px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  height: 38px;
  flex-shrink: 0;
}
.guess-input-wrap button { min-width: 76px; }
.guess-input-wrap button svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.guess-input-wrap button.is-sending svg { animation: guessArrowSend .43s cubic-bezier(.2,.8,.2,1); }
.guess-input-wrap input.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
  animation: guessInputError .4s ease-in-out;
}
@keyframes guessArrowSend {
  0% { opacity: 0; transform: translateX(-8px) scale(.75); }
  45% { opacity: 1; transform: translateX(2px) scale(1.08); }
  100% { opacity: .2; transform: translateX(12px) scale(.82); }
}
@keyframes guessInputError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.guessed-alert {
  display: none;
  background: var(--green-bg);
  color: #065f46;
  border: 1px solid var(--green-border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.guessed-alert.show {
  display: flex;
}

/* Modals */
.round-end {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.round-end.show {
  display: flex;
}

.round-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(32, 20, 64, 0.12);
  width: min(90%, 320px);
}

.round-card .badge {
  display: inline-block;
  font: 600 11px 'DM Mono', monospace;
  background: var(--purple-light);
  color: var(--purple);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.champion-badge {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

.champion-card {
  border-color: #fde68a;
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.15);
}

.trophy-icon {
  margin-bottom: 8px;
  animation: bounce-trophy 1.2s infinite alternate;
}

@keyframes bounce-trophy {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.round-card strong {
  display: block;
  font-size: 21px;
  color: var(--ink);
  margin-bottom: 4px;
}

.round-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.round-results { display: grid; gap: 7px; margin: -3px 0 15px; text-align: left; }
.round-result {
  display: grid; grid-template-columns: 23px 29px 1fr auto; align-items: center; gap: 7px;
  min-height: 38px; padding: 5px 9px;
  border: 1px solid #e9e2f2; border-radius: 11px; background: #faf8ff;
  animation: roundResultIn .46s calc(var(--result-index) * 90ms) cubic-bezier(.2,.85,.25,1) both;
}
.round-result em { color: #91869f; font: 800 11px 'DM Mono', monospace; text-align: center; }
.round-result b { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.round-result strong { margin: 0; color: #10a376; font: 900 12px 'DM Mono', monospace; }
.round-result .mini-avatar { width: 27px; height: 27px; flex-basis: 27px; }
.round-results-empty { display: block; padding: 9px; color: var(--muted); text-align: center; }
@keyframes roundResultIn {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.01); }
  to { transform: none; }
}

.champion-card { position: relative; isolation: isolate; overflow: hidden; padding-top: 27px; }
.champion-card > *:not(.champion-rays) { position: relative; z-index: 2; }
.champion-rays {
  position: absolute; z-index: 0; left: 50%; top: 42%; width: 310px; height: 310px;
  translate: -50% -50%; border-radius: 50%; opacity: .38;
  background: repeating-conic-gradient(from 0deg, rgba(245,158,11,.28) 0 10deg, transparent 10deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 38%, transparent 72%);
  mask-image: radial-gradient(circle, #000 0 38%, transparent 72%);
  animation: championRaysSpin 14s linear infinite;
}
.champion-avatar { display: grid; place-items: center; min-height: 69px; margin: -3px auto 5px; }
.champion-avatar .mini-avatar {
  width: 64px; height: 64px; flex-basis: 64px; border-width: 3px; border-radius: 45%;
  font-size: 22px; box-shadow: inset 0 -12px color-mix(in srgb, var(--avatar) 82%, transparent), 0 12px 25px rgba(78,48,23,.16);
  animation: championAvatarIn .72s .08s cubic-bezier(.2,.9,.2,1) both;
}
.champion-card .champion-badge { animation: championItemIn .45s .24s ease-out both; }
.champion-card #championName { animation: championItemIn .45s .34s ease-out both; }
.champion-card #championScore { animation: championItemIn .45s .42s ease-out both; }
.champion-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; animation: championItemIn .45s .5s ease-out both; }
.champion-invite {
  border: 1px solid #e4c563; border-radius: 12px; padding: 0 14px;
  background: #fff9df; color: #a15d08; font-weight: 900; cursor: pointer;
}
@keyframes championRaysSpin { to { rotate: 360deg; } }
@keyframes championAvatarIn {
  from { opacity: 0; translate: 0 18px; scale: .55; rotate: -10deg; }
  68% { opacity: 1; translate: 0 -4px; scale: 1.08; rotate: 3deg; }
  to { translate: 0; scale: 1; rotate: 0; }
}
@keyframes championItemIn { from { opacity: 0; transform: translateY(9px); filter: blur(3px); } }
[data-theme="dark"] .round-result { border-color: #44394f; background: #251e30; }
[data-theme="dark"] .round-result b { color: #f2edf8; }
[data-theme="dark"] .champion-invite { border-color: #765d2a; background: #302719; color: #f6ca70; }

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 160px);
  background: #1e1935;
  color: #fff;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform .25s ease-out;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
}

#toast.show {
  transform: translate(-50%, 0);
}

/* ============================================================
   MOBILE & TABLET RESPONSIVE (max-width: 860px)
   ============================================================ */
@media (max-width: 860px) {
  .app-container {
    padding: 6px 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 100dvh;
    height: auto;
  }

  .main-header {
    margin-bottom: 4px;
    height: 32px;
  }

  .logo {
    font-size: 19px;
  }

  .logo:before {
    width: 23px;
    height: 23px;
    border-radius: 6px;
  }

  .target-pill, .timer-pill {
    padding: 2px 7px;
    font-size: 11px;
  }

  .online {
    padding: 2px 7px;
    font-size: 9.5px;
  }

  #home {
    padding: 20px 0;
  }

  #home h1 {
    font-size: 34px;
    letter-spacing: -1.5px;
  }

  .lobby {
    padding: 16px;
  }

  .game-top {
    padding: 2px 0 6px;
    height: auto;
  }

  .btn-sm {
    padding: 0 8px;
    min-height: 30px;
    font-size: 11.5px;
  }

  .room-pill {
    padding: 3px 8px;
    font-size: 11px;
  }

  .turn-info {
    font-size: 11.5px;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .players-sidebar {
    border-right: 0;
    border-bottom: 1.5px solid var(--line);
    padding: 5px 6px;
    background: #fdfcff;
    height: auto;
  }

  .sidebar-head {
    display: none;
  }

  .players-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 5px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .players-list::-webkit-scrollbar {
    display: none;
  }

  .players-list li {
    margin: 0;
    white-space: nowrap;
    padding: 3px 7px;
    font-size: 11px;
    flex-shrink: 0;
    border-radius: 6px;
  }

  .players-list li b {
    font-size: 10px;
    padding: 1px 4px;
    margin-left: 3px;
  }

  .share, .share-box {
    display: none;
  }

  .draw-board {
    padding: 4px;
    background: #f7f5fb;
    height: auto;
  }

  .draw-title {
    min-height: 26px;
    margin-bottom: 3px;
    padding: 0 2px;
  }

  .role-badge {
    font-size: 9.5px;
    padding: 2px 5px;
  }

  .secret-word {
    font-size: 13.5px;
    font-weight: 700;
  }

  .btn-clear {
    padding: 2px 7px;
    font-size: 11px;
  }

  .draw-toolbar {
    padding: 3px 5px;
    gap: 4px;
    margin-bottom: 4px;
  }

  .btn-tool {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .btn-tool svg {
    width: 12px;
    height: 12px;
  }

  .btn-size {
    width: 20px;
    height: 22px;
  }

  .color-swatch {
    width: 18px;
    height: 18px;
  }

  /* Default Canvas for guessers on mobile */
  .canvas-wrap {
    width: 100%;
    aspect-ratio: 900 / 640;
    height: auto;
    max-height: clamp(230px, 36vh, 320px);
    border-radius: 10px;
    transition: max-height .25s ease-out;
  }

  /* EXPANDED CANVAS FOR DRAWER ON MOBILE */
  #game.is-drawer-turn .canvas-wrap {
    max-height: clamp(340px, 54vh, 480px);
  }

  /* Guess & Chat Panel on mobile */
  .guess-panel {
    border-left: 0;
    border-top: 1.5px solid var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .panel-header {
    display: none;
  }

  .chat-messages {
    min-height: 80px;
    max-height: 120px;
    height: clamp(80px, 13vh, 120px);
    padding: 5px 8px;
    gap: 4px;
    transition: height .25s ease-out;
  }

  #game.is-drawer-turn .chat-messages {
    min-height: 50px;
    max-height: 75px;
    height: clamp(50px, 8vh, 75px);
  }

  .chat-msg {
    font-size: 11.5px;
    padding: 3px 6px;
    border-radius: 6px;
  }

  .guess-form {
    padding: 5px 8px;
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 5;
  }

  .guess-input-wrap input {
    height: 36px;
    font-size: 16px;
    padding: 6px 8px;
  }

  .guess-input-wrap button {
    height: 36px;
    padding: 0 10px;
    font-size: 12.5px;
  }
}

/* ============================================================
   MINPIN 2026 VISUAL SYSTEM
   ============================================================ */
:root {
  --ink: #19142f;
  --purple: #6d45e8;
  --purple-dark: #5430cf;
  --purple-light: #f0ebff;
  --paper: #f8f6fd;
  --muted: #756c8d;
  --line: #e7e1f1;
  --surface: rgba(255, 255, 255, .88);
  --shadow-sm: 0 8px 24px rgba(41, 27, 79, .08);
  --shadow-lg: 0 26px 70px rgba(41, 27, 79, .14);
}

* { box-sizing: border-box; }

html { background: #f8f6fd; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 8%, rgba(153, 118, 255, .18), transparent 27rem),
    radial-gradient(circle at 92% 88%, rgba(34, 211, 238, .12), transparent 25rem),
    linear-gradient(145deg, #fbfaff 0%, #f6f2ff 52%, #f8fbff 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image: radial-gradient(rgba(79, 57, 135, .16) .65px, transparent .65px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

button, input, select { font-family: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(109, 69, 232, .25);
  outline-offset: 2px;
}

.app-container { max-width: 1440px; padding: 14px clamp(16px, 3vw, 44px) 22px; }
.main-header {
  position: relative;
  z-index: 90;
  height: 54px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(224, 216, 240, .76);
  border-radius: 17px;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 8px 28px rgba(55, 37, 95, .05);
  backdrop-filter: blur(18px);
}
.logo { font-size: 25px; letter-spacing: -1.35px; }
.logo::before { width: 31px; height: 31px; border-radius: 10px; box-shadow: 0 7px 16px rgba(109, 69, 232, .3); }
.logo span { font-size: 13px; padding-top: 7px; }
.header-right { gap: 7px; }
.target-pill, .timer-pill, .online { min-height: 32px; border-width: 1px; box-shadow: 0 3px 10px rgba(47, 35, 83, .04); }
.live-dot { box-shadow: 0 0 0 4px rgba(16, 185, 129, .11); }
.social-launch {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 11px;
  border-width: 1px;
  box-shadow: none;
  font-size: 12px;
}

/* Landing */
#home {
  display: none;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 64px) 12px 24px;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
  align-items: center;
  gap: clamp(36px, 7vw, 100px);
  text-align: left;
}
#home.active { display: grid; }
.hero-copy { position: relative; max-width: 650px; }
.hero-copy > .eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 7px 11px;
  border: 1px solid #ded5fb;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #6d55ad;
  box-shadow: var(--shadow-sm);
}
#home h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(53px, 6vw, 84px);
  line-height: .94;
  letter-spacing: -.065em;
}
#home h1 em {
  background: linear-gradient(110deg, #7047eb 8%, #9a52e9 55%, #ec4899 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Ana slogan: çizim, tahmin baloncukları ve oyunlu puan ritmi */
#home .hero-title { overflow: visible; }
#home .hero-title .title-line { display: inline-flex; align-items: baseline; gap: .17em; white-space: nowrap; }
.draw-title-word {
  position: relative; display: inline-flex; align-items: baseline; min-width: 1.72em;
  color: var(--ink); font-family: 'Caveat', cursive; font-size: 1.13em; font-weight: 700;
  letter-spacing: -.105em; transform: rotate(-2deg); transform-origin: left bottom;
}
.draw-letter { display: inline-block; opacity: 0; filter: blur(2px); transform-origin: left bottom; }
.draw-letter:nth-child(1) { animation: drawLetterOne 6.4s ease-out infinite; }
.draw-letter:nth-child(2) { animation: drawLetterTwo 6.4s ease-out infinite; }
.draw-letter:nth-child(3) { animation: drawLetterThree 6.4s ease-out infinite; }
.draw-letter:nth-child(4) { animation: drawLetterFour 6.4s ease-out infinite; }
.draw-letter.draw-dot { margin-left: -.04em; }
.draw-pencil {
  position: absolute; z-index: 2; left: -.04em; bottom: .03em;
  color: #f59e0b; font: 700 .34em/1 sans-serif; font-style: normal;
  filter: drop-shadow(1px 2px 0 rgba(62,42,99,.15));
  animation: titlePencilWrite 6.4s linear infinite;
}
@keyframes drawLetterOne { 0%, 3% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translate(-.08em,.08em) rotate(-8deg); } 8%, 100% { opacity: 1; clip-path: inset(-15%); filter: none; transform: none; } }
@keyframes drawLetterTwo { 0%, 8% { opacity: 0; clip-path: inset(100% 0 0); transform: translateY(-.08em); } 13%, 100% { opacity: 1; clip-path: inset(-15%); filter: none; transform: none; } }
@keyframes drawLetterThree { 0%, 13% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-.06em); } 18%, 100% { opacity: 1; clip-path: inset(-15%); filter: none; transform: none; } }
@keyframes drawLetterFour { 0%, 18% { opacity: 0; transform: scale(0); } 21%, 100% { opacity: 1; filter: none; transform: scale(1); } }
@keyframes titlePencilWrite {
  0%, 2% { opacity: 0; translate: 0 .12em; rotate: -18deg; }
  3% { opacity: 1; }
  8% { translate: 1.25em -.2em; rotate: -10deg; }
  13% { translate: 2.02em .04em; rotate: -17deg; }
  18% { translate: 3.05em .02em; rotate: -8deg; }
  21% { opacity: 1; translate: 3.38em .28em; rotate: 5deg; }
  24%, 100% { opacity: 0; translate: 3.38em .1em; }
}

.guess-title-word { position: relative; display: inline-block; }
.question-bubbles { position: absolute; inset: 0; pointer-events: none; }
.question-bubbles i {
  position: absolute; display: grid; place-items: center; width: 23px; height: 23px;
  border: 2px solid #bda9f6; border-radius: 50%; background: #fff; color: var(--purple);
  box-shadow: 0 5px 13px rgba(75,48,142,.16); font: 900 15px/1 Outfit, sans-serif; letter-spacing: 0;
  opacity: 0; animation: questionBubblePop 4.4s cubic-bezier(.2,.8,.25,1) infinite;
}
.question-bubbles i:nth-child(1) { left: 12%; top: -38%; animation-delay: .55s; }
.question-bubbles i:nth-child(2) { left: 56%; top: -31%; animation-delay: 1.2s; }
.question-bubbles i:nth-child(3) { right: -2%; top: -16%; animation-delay: 1.85s; }
@keyframes questionBubblePop {
  0%, 8% { opacity: 0; transform: translateY(8px) scale(.2); }
  15% { opacity: 1; transform: translateY(0) scale(1.08); }
  24% { opacity: 1; transform: translateY(-7px) scale(.92); }
  29% { opacity: 0; transform: translateY(-13px) scale(1.7); filter: blur(2px); }
  30%, 100% { opacity: 0; }
}

#home h1 .score-title {
  position: relative; display: inline-flex; align-items: baseline; gap: .12em;
  background: none; color: inherit; -webkit-text-fill-color: initial;
  transform: rotate(-1.2deg); transform-origin: left center;
}
.score-title .score-points {
  color: #7047eb; text-shadow: .035em .045em 0 #ddd2ff;
  animation: scoreWordHop 4s cubic-bezier(.2,.8,.25,1) infinite;
}
.score-title .score-collect {
  color: #ed477d; text-shadow: .035em .045em 0 #ffd7e5;
  animation: scoreWordHop 4s .13s cubic-bezier(.2,.8,.25,1) infinite;
}
.score-title > i {
  position: absolute; right: -.44em; top: -.16em; color: #f5a524;
  font: 900 .3em/1 sans-serif; font-style: normal;
  animation: scoreSpark 2.4s ease-in-out infinite;
}
@keyframes scoreWordHop {
  0%, 74%, 100% { transform: translateY(0) rotate(0); }
  80% { transform: translateY(-.08em) rotate(-1.5deg); }
  86% { transform: translateY(.015em) rotate(1deg); }
  91% { transform: translateY(-.025em); }
}
@keyframes scoreSpark {
  0%, 100% { opacity: .45; transform: scale(.72) rotate(0); }
  48% { opacity: 1; transform: scale(1.22) rotate(95deg); }
}
[data-theme="dark"] .question-bubbles i { border-color: #7258a8; background: #241a34; color: #c4adff; }
[data-theme="dark"] .score-title .score-points { color: #9f80ff; text-shadow: .035em .045em 0 #38255f; }
[data-theme="dark"] .score-title .score-collect { color: #ff739f; text-shadow: .035em .045em 0 #55233a; }
.lead { max-width: 560px; margin: 24px 0 22px; font-size: clamp(16px, 1.45vw, 19px); line-height: 1.62; }
.hero-features { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-features span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border: 1px solid rgba(222, 214, 240, .9);
  border-radius: 11px; background: rgba(255,255,255,.72); color: #5e5573;
  font-size: 13px; font-weight: 700; box-shadow: 0 5px 16px rgba(45,31,78,.04);
}
.hero-features i { font-style: normal; }
.hero-preview { position: relative; width: 330px; height: 175px; margin: 32px 0 0 30px; transform: rotate(-2deg); }
.preview-canvas {
  position: absolute; inset: 0; overflow: hidden; padding: 18px;
  border: 1px solid #e2d9f2; border-radius: 22px; background: rgba(255,255,255,.84);
  box-shadow: var(--shadow-lg); color: #4e426c;
}
.preview-canvas span { font-size: 22px; }
.preview-canvas b { margin-left: 5px; }
.preview-canvas svg { position: absolute; left: 28px; right: 20px; bottom: 16px; width: calc(100% - 48px); height: 90px; }
.preview-canvas path { fill: none; stroke: #794ee9; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 9 12; }
.preview-message, .preview-score {
  position: absolute; padding: 9px 13px; border-radius: 12px; background: #fff;
  box-shadow: 0 13px 32px rgba(45,29,83,.18); font-size: 13px; font-weight: 800;
}
.preview-message { left: -28px; bottom: 18px; color: #9a5a06; }
.preview-score { right: -28px; top: 30px; background: #eafbf3; color: #08795a; }

.lobby {
  position: relative;
  margin: 0;
  width: 100%;
  max-height: calc(100dvh - 110px);
  overflow: auto;
  scrollbar-width: thin;
  padding: clamp(20px, 2.3vw, 30px);
  border: 1px solid rgba(221, 212, 238, .92);
  border-radius: 26px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.lobby::before {
  content: 'OYUN ODASI'; display: block; margin-bottom: 16px; color: #34294d;
  font: 800 15px 'DM Mono', monospace; letter-spacing: .08em;
}
.lobby label, .quick-settings label { color: #706582; }
.lobby input, .quick-settings select, .quick-settings input, .join-password {
  border: 1px solid #ded7eb; background: #fcfbff; border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.lobby input:hover, .quick-settings select:hover { border-color: #c9bcec; }
.lobby input:focus, .quick-settings select:focus, .quick-settings input:focus {
  border-color: #8c6bea; background: #fff; box-shadow: 0 0 0 4px rgba(112,71,235,.1); outline: 0;
}
.score-pill, .quick-settings button { min-height: 39px; border-width: 1px; border-radius: 10px; }
.score-pill.active, .quick-settings button.active { box-shadow: 0 7px 16px rgba(109,69,232,.22); transform: translateY(-1px); }
.quick-settings { margin-bottom: 17px; }
.quick-settings label { margin-top: 12px; }
.primary {
  min-height: 48px; border-radius: 13px;
  background: linear-gradient(115deg, #6d45e8, #8152ef);
  box-shadow: 0 10px 22px rgba(109,69,232,.22);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(109,69,232,.3); filter: saturate(1.08); }
.primary:active { transform: translateY(0); }

/* L06 — Ana aksiyonlarda seyrek, dikkat dağıtmayan ışık geçişi */
#home .primary {
  isolation: isolate;
  overflow: hidden;
}
#home .primary::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: -70%;
  bottom: -70%;
  left: -42%;
  width: 28%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), rgba(255,255,255,.72), rgba(255,255,255,.18), transparent);
  filter: blur(1px);
  transform: translateX(-180%) rotate(16deg);
  animation: minpinButtonShimmer 5.2s 1.1s ease-in-out infinite;
}
#home .primary > * { position: relative; z-index: 1; }
#roomStep .primary::before { animation-delay: 2.1s; }
body.playing #home .primary::before { animation-play-state: paused; }
@keyframes minpinButtonShimmer {
  0%, 70%, 100% { transform: translateX(-180%) rotate(16deg); opacity: 0; }
  4% { opacity: .9; }
  16% { transform: translateX(620%) rotate(16deg); opacity: 0; }
}
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: #ede8f4; }
.join button { min-width: 78px; justify-content: center; border-radius: 11px; }

/* Game shell */
#game { padding-top: 12px; }
.game-top { height: 49px; padding: 0 4px 10px; }
.btn-sm { min-height: 36px; border-width: 1px; border-radius: 11px; box-shadow: 0 4px 12px rgba(44,31,76,.04); }
.room-pill { min-height: 36px; padding: 5px 12px; border: 1px solid #ded3fa; }
.turn-info { padding: 7px 11px; border-radius: 10px; background: rgba(255,255,255,.65); }
.game-layout {
  grid-template-columns: 220px minmax(420px, 1fr) 320px;
  height: calc(100dvh - 132px);
  max-height: none;
  border-width: 1px;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.players-sidebar { padding: 16px 13px; border-right-width: 1px; background: linear-gradient(180deg, #fdfcff, #f7f3ff); }
.sidebar-head { margin: 2px 4px 12px; }
.players-list { gap: 7px; }
.players-list li {
  min-height: 43px; padding: 8px 9px; border-width: 1px; border-radius: 11px;
  box-shadow: 0 4px 13px rgba(44,30,76,.035); transition: transform .16s, border-color .16s;
}
.players-list li:hover { transform: translateX(2px); }
.players-list li.is-drawer { box-shadow: inset 3px 0 #7047eb, 0 5px 14px rgba(74,46,145,.07); }
.players-list li.has-guessed { box-shadow: inset 3px 0 var(--green); }
.btn-share-card { min-height: 39px; border-width: 1px; border-radius: 11px; }
.draw-board { padding: 14px; background: linear-gradient(145deg, #f6f3fb, #f9f7fd); }
.draw-title { min-height: 40px; margin-bottom: 9px; }
.role-badge { padding: 6px 9px; border-radius: 8px; }
.secret-word { font-size: clamp(16px, 1.5vw, 21px); }
.btn-clear { min-height: 32px; border-width: 1px; border-radius: 9px; }
.draw-toolbar { border-width: 1px; border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow-sm); }
.btn-tool { width: 35px; height: 35px; border-width: 1px; border-radius: 9px; }
.canvas-wrap {
  border-width: 1px; border-radius: 17px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 10px 30px rgba(43,28,78,.07);
}
.guess-panel { border-left-width: 1px; }
.panel-header { min-height: 64px; justify-content: center; padding: 13px 16px; background: #fff; }
.panel-header #hint { margin-top: 3px; white-space: normal; line-height: 1.35; }
.chat-messages { padding: 13px; gap: 8px; background: linear-gradient(180deg, #fbfaff, #f8f5fd); }
.chat-msg { padding: 8px 10px; border-radius: 11px; line-height: 1.4; }
.chat-msg.guess { border-width: 1px; box-shadow: 0 3px 9px rgba(47,32,79,.03); }
.guess-form { padding: 12px; }
.guess-input-wrap { gap: 8px; }
.guess-input-wrap input { height: 44px; border-width: 1px; border-radius: 11px; }
.guess-input-wrap button { height: 44px; border-radius: 11px; padding: 0 17px; }
.word-picker { backdrop-filter: blur(9px); }
.word-picker-card { border: 1px solid #e4daf7; border-radius: 24px; padding: 27px; }
.word-picker-card button { min-height: 49px; border-width: 1px; border-radius: 13px; transition: transform .15s, background .15s; }
.word-picker-card button:hover { transform: translateY(-2px); }
.round-card { border-radius: 22px; box-shadow: var(--shadow-lg); }
#toast { border-radius: 13px; box-shadow: 0 15px 35px rgba(25,17,49,.24); }

/* Compact desktop/tablet */
@media (max-width: 1180px) and (min-width: 861px) {
  .app-container { padding-inline: 14px; }
  .game-layout { grid-template-columns: 180px minmax(390px, 1fr) 275px; }
  .players-sidebar { padding-inline: 9px; }
  .draw-board { padding: 10px; }
  .header-right { gap: 5px; }
}

/* Landing breakpoint */
@media (max-width: 900px) {
  .app-container { height: auto; min-height: 100dvh; }
  #home, #home.active { grid-template-columns: 1fr; justify-items: center; gap: 28px; padding-top: 40px; }
  .hero-copy { text-align: center; }
  .hero-copy > .eyebrow { margin-inline: auto; }
  .lead { margin-inline: auto; }
  .hero-features { justify-content: center; }
  .hero-preview { display: none; }
  .lobby { width: min(480px, 100%); max-height: none; }
}

/* True mobile game layout */
@media (max-width: 860px) {
  body { overflow-y: auto; }
  .app-container { padding: 8px 8px calc(64px + env(safe-area-inset-bottom)); }
  .main-header { height: 48px; padding: 6px 8px; border-radius: 14px; position: sticky; top: 6px; }
  .logo { font-size: 20px; }
  .logo::before { width: 27px; height: 27px; }
  .social-launch { min-height: 29px; padding: 4px 8px; }
  #home, #home.active { padding: 34px 8px 16px; }
  #home h1 { font-size: clamp(42px, 12vw, 60px); letter-spacing: -.055em; }
  .lead { margin-top: 18px; font-size: 16px; }
  .hero-features { gap: 6px; }
  .hero-features span { padding: 7px 9px; font-size: 11.5px; }
  .lobby { padding: 20px 16px; border-radius: 21px; }

  #game { padding-top: 9px; }
  .game-top { min-height: 42px; height: auto; padding: 0 1px 8px; }
  .top-left { gap: 5px; min-width: 0; }
  .btn-sm { min-height: 33px; padding: 0 8px; }
  .room-pill { min-height: 33px; padding: 4px 8px; }
  .turn-info { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; padding: 5px 7px; }
  .game-layout { border-radius: 17px; box-shadow: 0 16px 42px rgba(37,24,70,.12); }
  .players-sidebar { order: 1; padding: 7px; }
  .players-list { gap: 6px; }
  .players-list li { min-height: 35px; padding: 5px 7px; border-radius: 9px; }
  .draw-board { order: 2; padding: 7px; }
  .draw-title { min-height: 34px; margin-bottom: 5px; }
  .draw-toolbar { border-radius: 11px; padding: 5px; }
  .toolbar-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tools-selector, .sizes-selector { flex-shrink: 0; }
  .canvas-wrap { max-height: none; aspect-ratio: 900 / 640; border-radius: 13px; }
  #game.is-drawer-turn .canvas-wrap { max-height: none; }
  .guess-panel { order: 3; border-top-width: 1px; }
  .panel-header { display: flex; min-height: 44px; padding: 8px 10px; }
  .panel-header .eyebrow { display: none; }
  .panel-header #hint { font-size: 11.5px; }
  .chat-messages { min-height: 92px; height: 16vh; max-height: 155px; padding: 7px; }
  #game.is-drawer-turn .chat-messages { min-height: 60px; height: 10vh; max-height: 90px; }
  .guess-form { position: sticky; bottom: 0; padding: 7px; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .guess-input-wrap input, .guess-input-wrap button { height: 42px; }
  .reaction-bar { bottom: calc(8px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .header-right .target-pill, .header-right .online { display: none; }
  .social-launch span { display: none; }
  .main-header { padding-inline: 9px; }
  .logo span { display: none; }
  #home, #home.active { padding-top: 28px; }
  .hero-copy > .eyebrow { font-size: 9px; }
  #home h1 { font-size: clamp(39px, 12vw, 52px); }
  .lead { font-size: 14.5px; line-height: 1.5; }
  .hero-features span:last-child { display: none; }
  .lobby::before { font-size: 13px; }
  .score-pills { gap: 4px; }
  .score-pill { font-size: 11px; }
  .game-top .btn-invite span, .game-top #leave span { display: none; }
  .btn-sm { width: 34px; justify-content: center; padding: 0; }
  .turn-info { font-size: 10.5px; max-width: 31vw; }
  .player-avatar { display: none; }
  .players-list li { font-size: 10.5px; }
  .draw-board { padding: 5px; }
  .title-meta { gap: 5px; }
  .role-badge { font-size: 8.5px; }
  .secret-word { font-size: 12px; }
  .btn-clear span { display: none; }
  .btn-tool { width: 30px; height: 30px; }
  .color-swatch { width: 20px; height: 20px; }
  .social-modal { padding: 8px; }
  .social-card { max-height: 94dvh; }
}

@media (max-height: 720px) and (min-width: 901px) {
  #home { padding-block: 18px; }
  .hero-preview { display: none; }
  .lobby { padding-block: 18px; }
  .quick-settings label { margin-top: 7px; }
  .score-pill, .quick-settings button { min-height: 34px; padding-block: 5px; }
  .lobby input, .quick-settings select, .quick-settings input { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 100% masaüstü ölçeği: 1366–1920 px ekranlarda kaydırmasız lobi */
[hidden] { display: none !important; }
@media (min-width: 901px) {
  .app-container { max-width: 1320px; padding-top: 10px; }
  .main-header { height: 50px; }
  #home {
    width: min(1120px, 100%);
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: clamp(42px, 5vw, 72px);
    padding: 22px 8px 14px;
  }
  #home h1 { max-width: 590px; font-size: clamp(50px, 4.4vw, 68px); }
  .lead { margin-block: 18px 17px; font-size: 16px; }
  .hero-preview { width: 280px; height: 142px; margin-top: 24px; }
  .preview-canvas { padding: 14px; border-radius: 18px; }
  .preview-canvas svg { height: 70px; }
  .lobby {
    max-height: none;
    overflow: visible;
    padding: 18px 20px;
    border-radius: 22px;
  }
  .lobby::before { margin-bottom: 10px; font-size: 13px; }
  .lobby input { height: 39px; margin: 4px 0 8px; padding-block: 7px; }
  .score-picker-wrap { margin-bottom: 8px; }
  .score-pills { margin-top: 4px; }
  .score-pill, .quick-settings button { min-height: 35px; padding-block: 5px; }
  .quick-settings { margin-bottom: 10px; }
  .quick-settings label { margin: 7px 0 3px; }
  .quick-settings select, .quick-settings input { height: 38px; margin: 0 0 2px; }
  .primary { min-height: 43px; }
  .divider { margin: 9px 0; }
}

/* ============================================================
   ANIMATED LIGHT / DARK THEME
   ============================================================ */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) { z-index: 9999; }
::view-transition-old(root) { z-index: 1; }

.theme-toggle {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border: 1px solid #ded7ed;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  color: #5d5276;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(45,31,77,.06);
  transition: transform .2s, color .25s, background .25s, border-color .25s;
}
.theme-toggle:hover { transform: translateY(-1px) rotate(8deg); color: #7047eb; }
.theme-toggle:active { transform: scale(.92); }
.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity .32s, transform .5s cubic-bezier(.2,.8,.2,1);
}
.theme-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-moon { opacity: 0; transform: translateY(20px) rotate(80deg) scale(.5); }
[data-theme="dark"] .theme-sun { opacity: 0; transform: translateY(-20px) rotate(-100deg) scale(.5); }
[data-theme="dark"] .theme-moon { opacity: 1; transform: translateY(0) rotate(0) scale(1); }

[data-theme="dark"] {
  --ink: #f5f1ff;
  --purple: #9b7aff;
  --purple-dark: #b19aff;
  --purple-light: #302750;
  --paper: #100d19;
  --muted: #aaa0bd;
  --line: #373044;
  --surface: rgba(28, 23, 39, .9);
  --green-bg: #102f29;
  --green-border: #176a58;
  --amber-bg: #382b10;
  --amber-border: #765718;
  --red-bg: #3b191d;
  --red-border: #7a2931;
  --shadow-sm: 0 8px 25px rgba(0,0,0,.22);
  --shadow-lg: 0 28px 75px rgba(0,0,0,.38);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 8%, rgba(116, 76, 220, .22), transparent 28rem),
    radial-gradient(circle at 92% 88%, rgba(18, 116, 137, .15), transparent 26rem),
    linear-gradient(145deg, #100d19 0%, #151020 52%, #0e131c 100%);
}
[data-theme="dark"] body::before { opacity: .25; background-image: radial-gradient(rgba(197,178,242,.2) .65px, transparent .65px); }
[data-theme="dark"] .main-header {
  border-color: rgba(67,57,83,.85);
  background: rgba(25,20,35,.76);
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
}
[data-theme="dark"] .logo { color: #fff; }
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .social-launch,
[data-theme="dark"] .target-pill,
[data-theme="dark"] .timer-pill,
[data-theme="dark"] .online {
  border-color: #443a57;
  background: #211b2e;
  color: #c8bddb;
}
[data-theme="dark"] .target-pill { color: #bdaaff; background: #2d2449; }
[data-theme="dark"] .hero-copy > .eyebrow,
[data-theme="dark"] .hero-features span {
  border-color: #413650;
  background: rgba(31,25,43,.78);
  color: #c5bad7;
}
[data-theme="dark"] .lead { color: #aaa0bd; }
[data-theme="dark"] .preview-canvas,
[data-theme="dark"] .preview-message,
[data-theme="dark"] .preview-score {
  border-color: #41374e;
  background: #211b2d;
  color: #e6def4;
  box-shadow: 0 18px 45px rgba(0,0,0,.3);
}
[data-theme="dark"] .preview-score { background: #13342c; color: #62dfb8; }
[data-theme="dark"] .preview-message { color: #f6c263; }

[data-theme="dark"] .lobby,
[data-theme="dark"] .social-card,
[data-theme="dark"] .word-picker-card,
[data-theme="dark"] .round-card {
  border-color: #3d344a;
  background: rgba(27,22,37,.94);
  color: #f5f1ff;
}
[data-theme="dark"] .lobby::before { color: #eee7fb; }
[data-theme="dark"] .lobby label,
[data-theme="dark"] .quick-settings label,
[data-theme="dark"] .social-content > label { color: #afa5c1; }
[data-theme="dark"] .lobby input,
[data-theme="dark"] .quick-settings input,
[data-theme="dark"] .quick-settings select,
[data-theme="dark"] .join-password,
[data-theme="dark"] .social-content input {
  border-color: #453b53;
  background: #1c1726;
  color: #f5f1ff;
}
[data-theme="dark"] input::placeholder { color: #71677f; }
[data-theme="dark"] .score-pill,
[data-theme="dark"] .quick-settings button,
[data-theme="dark"] .join button,
[data-theme="dark"] .btn-sm {
  border-color: #443a53;
  background: #211b2c;
  color: #cfc5de;
}
[data-theme="dark"] .score-pill:hover,
[data-theme="dark"] .quick-settings button:hover,
[data-theme="dark"] .join button:hover { border-color: #9b7aff; color: #bca9ff; }
[data-theme="dark"] .score-pill.active,
[data-theme="dark"] .quick-settings button.active { border-color: #8c68f8; background: #7951ee; color: #fff; }
[data-theme="dark"] .divider { color: #81778e; }
[data-theme="dark"] .divider::before,
[data-theme="dark"] .divider::after { background: #39313f; }

[data-theme="dark"] .turn-info { background: rgba(31,25,42,.75); color: #aaa0bd; }
[data-theme="dark"] .room-pill { border-color: #4b3a75; background: #2d2448; color: #beaaff; }
[data-theme="dark"] .room-pill button { background: #191421; color: #bda8ff; }
[data-theme="dark"] .game-layout { border-color: #393142; background: #191520; }
[data-theme="dark"] .players-sidebar { border-color: #393142; background: linear-gradient(180deg, #1d1826, #18131f); }
[data-theme="dark"] .players-list li {
  border-color: #3c3347;
  background: #241e2e;
  color: #eee8f8;
  box-shadow: 0 5px 14px rgba(0,0,0,.12);
}
[data-theme="dark"] .players-list li.is-drawer { border-color: #7656d3; background: #2b2241; }
[data-theme="dark"] .players-list li.has-guessed { border-color: #176a58; background: #122d28; }
[data-theme="dark"] .players-list li b { background: #342a50; color: #c4b2ff; }
[data-theme="dark"] .btn-share-card,
[data-theme="dark"] .btn-invite { border-color: #4c3b73; background: #2d2447; color: #bdaaff; }
[data-theme="dark"] .draw-board { background: linear-gradient(145deg, #17131f, #1c1725); }
[data-theme="dark"] .role-badge { background: #30274d; color: #c0aeff; }
[data-theme="dark"] .btn-clear,
[data-theme="dark"] .draw-toolbar {
  border-color: #40364c;
  background: #231d2d;
  color: #ddd4ea;
}
[data-theme="dark"] .btn-tool { border-color: #453a53; background: #1c1725; color: #c8bdd6; }
[data-theme="dark"] .btn-tool:hover { border-color: #9b7aff; color: #bdaaff; }
[data-theme="dark"] .btn-tool.active { border-color: #8e6cf5; background: #7853e7; color: #fff; }
[data-theme="dark"] .sizes-selector { border-color: #41374c; background: #1a1622; }
[data-theme="dark"] .btn-size.active { background: #393043; box-shadow: none; }
[data-theme="dark"] .dot-sm,
[data-theme="dark"] .dot-md,
[data-theme="dark"] .dot-lg,
[data-theme="dark"] .dot-xl { background: #eee7fa; }
[data-theme="dark"] .canvas-wrap { border-color: #403649; background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
[data-theme="dark"] .guess-panel { border-color: #393142; background: #1c1724; }
[data-theme="dark"] .panel-header,
[data-theme="dark"] .guess-form { border-color: #393142; background: #211b2a; }
[data-theme="dark"] .chat-messages { background: linear-gradient(180deg, #19151f, #17121d); }
[data-theme="dark"] .chat-msg.guess { border-color: #3d3447; background: #241e2d; color: #ddd5e8; }
[data-theme="dark"] .chat-msg.guess .sender { color: #c5b5ed; }
[data-theme="dark"] .chat-msg.system { background: #292331; color: #aaa0b8; }
[data-theme="dark"] .chat-msg.drawer { border-color: #514175; background: #2e2544; color: #d7caff; }
[data-theme="dark"] .guess-input-wrap input { border-color: #453a51; background: #18131f; color: #f4effc; }

[data-theme="dark"] .social-tabs button { background: #241e2e; color: #aaa0ba; }
[data-theme="dark"] .social-tabs button.active { background: #7852e9; color: #fff; }
[data-theme="dark"] .profile-preview { background: #251e33; }
[data-theme="dark"] .friend-list > div,
[data-theme="dark"] .ranking-list > div { border-color: #3d3448; background: #201a29; }
[data-theme="dark"] .social-content hr { border-color: #3a3144; }
[data-theme="dark"] .social-close { color: #b4a9c5; }
[data-theme="dark"] .word-picker { background: rgba(8,6,12,.72); }
[data-theme="dark"] .word-picker-card button { border-color: #493b70; background: #2b2340; color: #c5b4ff; }
[data-theme="dark"] .round-end { background: rgba(18,14,25,.94); }
[data-theme="dark"] .reaction-bar { border-color: #41364e; background: rgba(31,25,41,.94); }
[data-theme="dark"] .reaction-bar button:hover { background: #392d51; }
[data-theme="dark"] #toast { background: #eee7fa; color: #191320; }

@media (max-width: 600px) {
  .theme-toggle { width: 31px; height: 31px; flex-basis: 31px; }
  .theme-toggle svg { width: 15px; height: 15px; }
}

/* ============================================================
   TWO-STEP LOBBY & ORIGINAL AVATAR BUILDER
   ============================================================ */
.lobby::before { display: none; }
.lobby-step { display: none; animation: lobbyStepIn .32s cubic-bezier(.2,.8,.2,1); }
.lobby-step.active { display: block; }
@keyframes lobbyStepIn { from { opacity: 0; transform: translateY(9px) scale(.985); } to { opacity: 1; transform: none; } }

.step-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; text-align: left; }
.step-heading > div { display: flex; flex-direction: column; gap: 2px; }
.step-heading b { color: var(--ink); font-size: 17px; }
.step-heading small { color: var(--muted); font-size: 12px; }
.step-count {
  display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 10px; background: var(--purple-light); color: var(--purple);
  font: 800 13px 'DM Mono', monospace;
}

.avatar-builder {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 19px;
  margin-bottom: 17px;
  padding: 15px;
  border: 1px solid #e8e1f1;
  border-radius: 18px;
  background: linear-gradient(145deg, #faf8ff, #f5f1ff);
}
.avatar-preview {
  position: relative;
  --avatar-base-scale: 1;
  width: 124px;
  height: 137px;
  margin: auto;
  filter: drop-shadow(0 11px 13px rgba(55,35,100,.15));
  transform: scale(var(--avatar-base-scale));
  transition: transform .22s;
}
.avatar-preview:hover { transform: scale(var(--avatar-base-scale)) translateY(-3px) rotate(-2deg); }
.avatar-face {
  position: absolute; z-index: 3; left: 17px; top: 2px; width: 90px; height: 90px;
  border: 4px solid #29213e; border-radius: 44% 44% 47% 47%;
  background: color-mix(in srgb, var(--avatar) 62%, white);
}
.avatar-body {
  position: absolute; z-index: 1; left: 12px; bottom: 0; width: 100px; height: 65px;
  border: 4px solid #29213e; border-radius: 45px 45px 20px 20px;
  background: var(--avatar);
}
.avatar-eye { position: absolute; top: 34px; width: 8px; height: 11px; border-radius: 50%; background: #29213e; }
.avatar-eye.left { left: 24px; }
.avatar-eye.right { right: 24px; }
.avatar-mouth {
  position: absolute; left: 50%; bottom: 18px; width: 26px; height: 12px;
  border: 3px solid #29213e; border-top: 0; border-radius: 0 0 18px 18px; transform: translateX(-50%);
}
.avatar-ear { display: none; position: absolute; z-index: 2; top: -5px; width: 36px; height: 38px; border: 4px solid #29213e; background: var(--avatar); transform: rotate(45deg); }
.avatar-ear.left { left: 11px; border-radius: 8px 0; }
.avatar-ear.right { right: 11px; border-radius: 0 8px; }
.avatar-hair {
  position: absolute; z-index: 6; pointer-events: none;
  background: #29213e; transform-origin: 50% 100%;
}
.avatar-hair.hair-none { display: none; }
.avatar-hair.hair-tuft {
  left: 39px; top: -11px; width: 48px; height: 40px;
  border-radius: 55% 45% 48% 30%;
  clip-path: polygon(0 75%, 13% 19%, 34% 47%, 49% 0, 64% 45%, 93% 16%, 79% 82%);
}
.avatar-hair.hair-side {
  left: 19px; top: -5px; width: 87px; height: 45px;
  border-radius: 58px 50px 16px 13px;
  clip-path: polygon(0 74%, 9% 29%, 34% 4%, 77% 0, 100% 28%, 83% 30%, 67% 48%, 45% 38%, 25% 62%);
}
.avatar-hair.hair-curls {
  left: 22px; top: -9px; width: 24px; height: 24px; border-radius: 50%;
  box-shadow: 18px -5px #29213e, 37px -4px #29213e, 55px 1px #29213e, 9px 11px #29213e, 29px 8px #29213e, 48px 10px #29213e;
}
.avatar-hair.hair-mohawk {
  left: 48px; top: -25px; width: 34px; height: 48px;
  border-radius: 50% 50% 12px 12px;
  clip-path: polygon(4% 100%, 0 35%, 24% 48%, 35% 0, 53% 43%, 88% 12%, 78% 100%);
}

.avatar-preview.is-morphing { animation: avatarMorph .42s cubic-bezier(.2,.9,.25,1); }
.avatar-preview.is-morphing .avatar-face,
.avatar-preview.is-morphing .avatar-ear,
.avatar-preview.is-morphing .avatar-hair,
.avatar-preview.is-morphing .avatar-eye,
.avatar-preview.is-morphing .avatar-mouth { animation: avatarPartMorph .42s cubic-bezier(.2,.9,.25,1); }
.avatar-preview.is-coloring { animation: avatarColorPop .34s cubic-bezier(.2,.9,.25,1); }
.avatar-preview.is-celebrating { animation: avatarCelebrate .62s cubic-bezier(.2,.85,.25,1); }
.avatar-preview.is-celebrating::after {
  content: '✦'; position: absolute; z-index: 8; right: 2px; top: -13px;
  color: #f6b91a; font-size: 26px; text-shadow: -21px 13px #a855f7, 5px 28px #22d3ee;
  animation: avatarSparkle .62s ease-out both;
}
.avatar-preview.is-celebrating .avatar-eye { animation: avatarBlink .62s ease-in-out; }
@keyframes avatarMorph {
  0% { scale: 1; rotate: 0deg; }
  34% { scale: .88 1.1; rotate: -3deg; }
  68% { scale: 1.07 .94; rotate: 2deg; }
  100% { scale: 1; rotate: 0deg; }
}
@keyframes avatarPartMorph {
  0% { opacity: .25; filter: blur(5px); }
  55% { opacity: 1; filter: blur(0); }
}
@keyframes avatarColorPop {
  0% { scale: 1; }
  45% { scale: .92 1.08; filter: saturate(1.45); }
  75% { scale: 1.05 .96; }
  100% { scale: 1; }
}
@keyframes avatarCelebrate {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  22% { translate: 0 3px; scale: 1.05 .94; }
  48% { translate: 0 -18px; rotate: -4deg; scale: .96 1.06; }
  70% { translate: 0 0; rotate: 3deg; scale: 1.07 .94; }
  86% { translate: 0 -4px; rotate: -1deg; }
}
@keyframes avatarBlink {
  0%, 32%, 54%, 100% { scale: 1 1; }
  40%, 47% { scale: 1 .12; }
}
@keyframes avatarSparkle {
  0% { opacity: 0; scale: .3; rotate: -20deg; }
  35% { opacity: 1; scale: 1.12; }
  100% { opacity: 0; scale: .7; rotate: 35deg; translate: 0 -10px; }
}

.avatar-preview.avatar-cool .avatar-eye { top: 32px; width: 27px; height: 15px; border-radius: 3px; }
.avatar-preview.avatar-cool .avatar-eye.left { left: 14px; transform: rotate(4deg); }
.avatar-preview.avatar-cool .avatar-eye.right { right: 14px; transform: rotate(-4deg); }
.avatar-preview.avatar-cool .avatar-extra { position: absolute; left: 40px; top: 37px; width: 10px; height: 3px; background: #29213e; }
.avatar-preview.avatar-cool .avatar-mouth { width: 19px; transform: translateX(-50%) rotate(-7deg); }

.avatar-preview.avatar-bot .avatar-face { border-radius: 20px; background: color-mix(in srgb, var(--avatar) 38%, white); }
.avatar-preview.avatar-bot .avatar-face::before { content: ''; position: absolute; left: 39px; top: -19px; width: 5px; height: 17px; background: #29213e; }
.avatar-preview.avatar-bot .avatar-face::after { content: ''; position: absolute; left: 33px; top: -25px; width: 15px; height: 15px; border: 3px solid #29213e; border-radius: 50%; background: var(--avatar); }
.avatar-preview.avatar-bot .avatar-eye { width: 15px; height: 12px; border-radius: 3px; background: var(--avatar); }
.avatar-preview.avatar-bot .avatar-mouth { height: 4px; border: 0; border-radius: 3px; background: #29213e; }

.avatar-preview.avatar-cat .avatar-ear { display: block; }
.avatar-preview.avatar-cat .avatar-face { border-radius: 46% 46% 42% 42%; }
.avatar-preview.avatar-cat .avatar-mouth { width: 18px; height: 9px; }
.avatar-preview.avatar-cat .avatar-extra::before,
.avatar-preview.avatar-cat .avatar-extra::after { content: ''; position: absolute; bottom: 21px; width: 25px; height: 2px; background: #29213e; box-shadow: 0 6px #29213e; }
.avatar-preview.avatar-cat .avatar-extra::before { left: -9px; transform: rotate(7deg); }
.avatar-preview.avatar-cat .avatar-extra::after { right: -9px; transform: rotate(-7deg); }

.avatar-preview.avatar-happy .avatar-eye { height: 8px; background: transparent; border: 3px solid #29213e; border-bottom: 0; border-radius: 10px 10px 0 0; }
.avatar-preview.avatar-happy .avatar-mouth { width: 32px; height: 17px; background: #fff; }
.avatar-preview.avatar-happy .avatar-extra::after { content: '✦'; position: absolute; right: -12px; top: -14px; color: #facc15; font-size: 27px; text-shadow: 1px 2px #29213e; }

.avatar-editor { min-width: 0; }
.avatar-editor label { margin: 0 0 6px; }
.avatar-editor label:not(:first-child) { margin-top: 13px; }
.avatar-styles, .avatar-hairs, .onboarding-colors, .profile-avatar-styles, .profile-avatar-hairs { display: flex; flex-wrap: wrap; gap: 7px; }
.avatar-styles button, .avatar-hairs button, .profile-avatar-styles button, .profile-avatar-hairs button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid #ded6eb; border-radius: 10px; background: #fff;
  color: #4f4464; font: 800 13px 'DM Mono', monospace; cursor: pointer;
}
.avatar-styles button.active, .avatar-hairs button.active, .profile-avatar-styles button.active, .profile-avatar-hairs button.active {
  border-color: var(--purple); background: var(--purple-light); color: var(--purple);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple) 18%, transparent);
}
.hair-choice { position: relative; display: block; width: 23px; height: 20px; color: currentColor; }
.hair-choice-none { height: auto; font-size: 16px; line-height: 1; }
.hair-choice-tuft { background: currentColor; clip-path: polygon(0 90%, 12% 20%, 35% 53%, 50% 0, 65% 50%, 95% 22%, 80% 92%); }
.hair-choice-side { background: currentColor; border-radius: 13px 12px 4px 3px; clip-path: polygon(0 83%, 8% 27%, 36% 5%, 79% 0, 100% 28%, 77% 39%, 51% 34%, 24% 68%); }
.hair-choice-curls { width: 7px; height: 7px; margin: 0 12px 7px 0; border-radius: 50%; background: currentColor; box-shadow: 7px -3px currentColor, 14px 0 currentColor, 4px 6px currentColor, 11px 5px currentColor, 18px 6px currentColor; }
.hair-choice-mohawk { width: 18px; margin-left: 3px; background: currentColor; clip-path: polygon(6% 100%, 0 35%, 25% 48%, 37% 0, 55% 43%, 91% 12%, 80% 100%); }
.onboarding-colors button {
  width: 25px; height: 25px; padding: 0; border: 3px solid #fff; border-radius: 50%;
  background: var(--avatar); box-shadow: 0 0 0 1px #d9d0e7; cursor: pointer;
}
.onboarding-colors button.active { box-shadow: 0 0 0 3px var(--purple); transform: scale(.92); }
.identity-next { margin-top: 4px; }

.room-step-heading { margin-bottom: 13px; }
.step-back {
  display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px;
  border: 1px solid #ded6eb; border-radius: 10px; background: #fff; color: #514665;
  font-size: 19px; cursor: pointer;
}
.identity-summary {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 9px 11px;
  border: 1px solid #e4dced; border-radius: 13px; background: #faf8ff;
}
.identity-summary > div { display: flex; flex: 1; flex-direction: column; }
.identity-summary small { color: var(--muted); font: 700 9px 'DM Mono', monospace; letter-spacing: .08em; }
.identity-summary b { color: var(--ink); font-size: 14px; }
.identity-summary > button { border: 0; background: transparent; color: var(--purple); font-size: 11px; font-weight: 800; cursor: pointer; }
.identity-mini { display: contents; }
.mini-avatar {
  position: relative;
  display: inline-grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px;
  border: 2px solid color-mix(in srgb, var(--avatar) 68%, #2a213d);
  border-radius: 45%; background: color-mix(in srgb, var(--avatar) 70%, white);
  color: #29213e; font-style: normal; font: 900 11px 'DM Mono', monospace;
  box-shadow: inset 0 -6px color-mix(in srgb, var(--avatar) 82%, transparent);
}
.mini-avatar::before { content: ''; position: absolute; z-index: 2; left: 3px; right: 3px; top: -5px; height: 10px; background: #29213e; }
.mini-avatar.hair-none::before { display: none; }
.mini-avatar.hair-tuft::before { left: 7px; right: 5px; top: -6px; height: 12px; clip-path: polygon(0 100%, 12% 25%, 35% 55%, 52% 0, 67% 52%, 100% 24%, 82% 100%); }
.mini-avatar.hair-side::before { top: -3px; height: 9px; border-radius: 10px 10px 2px 2px; clip-path: polygon(0 100%, 8% 25%, 38% 0, 100% 22%, 75% 48%, 45% 38%, 20% 80%); }
.mini-avatar.hair-curls::before { left: 3px; right: auto; top: -4px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 6px -2px #29213e, 12px -1px #29213e, 17px 2px #29213e, 4px 4px #29213e, 10px 4px #29213e; }
.mini-avatar.hair-mohawk::before { left: 9px; right: auto; top: -9px; width: 11px; height: 14px; clip-path: polygon(0 100%, 0 35%, 25% 48%, 40% 0, 58% 42%, 95% 14%, 80% 100%); }
.mini-avatar.avatar-bot { border-radius: 7px; }
.mini-avatar.avatar-cat { clip-path: polygon(0 18%,18% 18%,27% 0,42% 18%,58% 18%,73% 0,82% 18%,100% 18%,100% 100%,0 100%); padding-top: 3px; }
.mini-avatar.avatar-cool span { transform: rotate(-8deg); }
.mini-avatar.avatar-happy { border-radius: 50%; }
.player-name-wrap .mini-avatar { width: 24px; height: 24px; flex-basis: 24px; }
.profile-preview .mini-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 17px; }

[data-theme="dark"] .avatar-builder { border-color: #40364b; background: linear-gradient(145deg, #211b2c, #271f36); }
[data-theme="dark"] .avatar-face { border-color: #16111f; }
[data-theme="dark"] .avatar-body,
[data-theme="dark"] .avatar-ear { border-color: #16111f; }
[data-theme="dark"] .avatar-eye,
[data-theme="dark"] .avatar-preview.avatar-cool .avatar-extra,
[data-theme="dark"] .avatar-preview.avatar-bot .avatar-mouth { background-color: #16111f; }
[data-theme="dark"] .avatar-mouth { border-color: #16111f; }
[data-theme="dark"] .avatar-styles button,
[data-theme="dark"] .profile-avatar-styles button,
[data-theme="dark"] .avatar-hairs button,
[data-theme="dark"] .profile-avatar-hairs button,
[data-theme="dark"] .step-back { border-color: #453a52; background: #211b2b; color: #c9bed8; }
[data-theme="dark"] .identity-summary { border-color: #403649; background: #211b2b; }
[data-theme="dark"] .onboarding-colors button { border-color: #211b2b; }

@media (max-width: 600px) {
  .step-heading { margin-bottom: 14px; }
  .avatar-builder { grid-template-columns: 115px 1fr; gap: 12px; padding: 12px 10px; }
  .avatar-preview { --avatar-base-scale: .86; width: 105px; height: 118px; transform-origin: center; }
  .avatar-preview:hover { transform: scale(var(--avatar-base-scale)); }
  .avatar-styles button { width: 31px; height: 31px; }
  .avatar-hairs button { width: 31px; height: 31px; }
  .onboarding-colors button { width: 22px; height: 22px; }
}

/* ============================================================
   FIRST VISUAL EFFECT PACK — L01 L02 L03 G01 G02 G03 G04 S01 M01
   ============================================================ */
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  inset: -40px;
  pointer-events: none;
  background: url('/assets/minpin-pattern.svg?v=1') repeat;
  background-size: 260px 180px;
  opacity: .16;
  animation: minpinPatternDrift 38s linear infinite;
  transition: opacity .5s;
}
body.playing::after { opacity: .035; animation-play-state: paused; }
.app-container { position: relative; z-index: 1; }
@keyframes minpinPatternDrift { to { transform: translate3d(260px, 180px, 0); } }
[data-theme="dark"] body::after { opacity: .09; filter: saturate(.8) brightness(1.35); }
[data-theme="dark"] body.playing::after { opacity: .025; }

#home.active .hero-copy > .eyebrow { animation: minpinBlurIn .52s .04s both; }
#home.active .hero-copy > h1 { animation: minpinBlurIn .62s .12s both; }
#home.active .hero-copy > .rotating-slogan { animation: minpinBlurIn .6s .17s both; }
#home.active .hero-copy > .lead { animation: minpinBlurIn .62s .2s both; }
#home.active .hero-features { animation: minpinBlurIn .58s .28s both; }
#home.active .hero-preview { animation: minpinPreviewIn .68s .34s both; }
#home.active > .lobby { animation: minpinCardIn .65s .12s both; }
@keyframes minpinBlurIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(9px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes minpinPreviewIn {
  from { opacity: 0; transform: translateY(22px) rotate(-5deg) scale(.94); }
  to { opacity: 1; transform: rotate(-2deg); }
}
@keyframes minpinCardIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.rotating-slogan {
  min-height: 29px;
  margin: 15px 0 5px;
  overflow: hidden;
  color: var(--purple);
  font: 800 14px 'DM Mono', monospace;
  letter-spacing: .025em;
}
.rotating-slogan::before { content: '✦'; margin-right: 8px; color: #ec4899; }
.rotating-slogan span { display: inline-block; will-change: transform, opacity, filter; }
.rotating-slogan span.is-leaving { animation: minpinSloganOut .23s ease-in both; }
.rotating-slogan span.is-entering { animation: minpinSloganIn .46s cubic-bezier(.2,.8,.2,1) both; }
@keyframes minpinSloganOut { to { opacity: 0; transform: translateY(-9px); filter: blur(5px); } }
@keyframes minpinSloganIn { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }
[data-theme="dark"] .rotating-slogan { color: #b9a5ff; }
.home-presence { white-space: nowrap; }
.home-presence i {
  display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0;
  border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,.12);
  animation: homePresencePulse 2.2s ease-in-out infinite;
}
.home-presence b { display: inline-block; min-width: 1.2ch; color: #0a9b70; font: inherit; }
@keyframes homePresencePulse { 50% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } }
[data-theme="dark"] .home-presence b { color: #49d9ad; }

.avatar-builder {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.avatar-builder::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  left: calc(var(--glow-x, -300px) - 115px);
  top: calc(var(--glow-y, -300px) - 115px);
  border-radius: 50%;
  pointer-events: none;
  opacity: .72;
  background: radial-gradient(circle, rgba(140,98,245,.25), rgba(236,72,153,.09) 42%, transparent 68%);
  transition: left .08s linear, top .08s linear, opacity .25s;
}
.avatar-builder:not(:hover)::before { opacity: 0; }

.effects-layer { position: fixed; inset: 0; z-index: 2500; pointer-events: none; overflow: hidden; }
.confetti-particle {
  position: absolute;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: var(--confetti);
  box-shadow: 0 2px 5px rgba(21,13,40,.15);
  will-change: transform, opacity;
}
.confetti-particle.is-star {
  width: 16px;
  height: 16px;
  clip-path: polygon(50% 0,61% 35%,98% 35%,68% 56%,79% 94%,50% 71%,21% 94%,32% 56%,2% 35%,39% 35%);
}

.round-countdown {
  position: absolute;
  z-index: 45;
  inset: 0;
  display: none;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.72), rgba(255,255,255,.2) 42%, transparent 68%);
  backdrop-filter: blur(1px);
}
.round-countdown.show { display: grid; }
.round-countdown b {
  color: var(--purple);
  font-size: clamp(68px, 10vw, 128px);
  font-weight: 900;
  letter-spacing: -.06em;
  text-shadow: 0 9px 28px rgba(103,63,224,.25), 0 3px #fff;
}
.canvas-wrap.counting-down canvas { pointer-events: none; }
[data-theme="dark"] .round-countdown { background: radial-gradient(circle, rgba(27,21,38,.72), rgba(27,21,38,.2) 42%, transparent 68%); }
[data-theme="dark"] .round-countdown b { color: #b49cff; text-shadow: 0 10px 32px rgba(123,79,240,.4), 0 3px #17111f; }

@property --minpin-beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.canvas-wrap.turn-border-beam::before {
  content: '';
  position: absolute;
  z-index: 50;
  inset: 0;
  padding: 4px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(from var(--minpin-beam-angle), transparent 0 70%, #22d3ee 77%, #a855f7 83%, #ec4899 89%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: minpinBorderBeam .72s linear 2;
}
@keyframes minpinBorderBeam { to { --minpin-beam-angle: 360deg; } }

.player-actions { position: relative; }
.score-number { display: inline-block; min-width: 1.6ch; text-align: right; font-variant-numeric: tabular-nums; }
.score-gain {
  position: absolute;
  right: 3px;
  top: -20px;
  color: #059669;
  font: 900 11px 'DM Mono', monospace;
  pointer-events: none;
  animation: scoreGainFloat 1.15s ease-out forwards;
}
@keyframes scoreGainFloat { from { opacity: 0; transform: translateY(7px) scale(.7); } 18% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-16px) scale(1.05); } }
[data-theme="dark"] .score-gain { color: #5de0b4; }

.players-list li { will-change: transform; }
.players-list li::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 2px rgba(112,71,235,.22);
}
.players-list li { position: relative; }

button { position: relative; overflow: hidden; }
.button-ripple {
  position: absolute;
  z-index: 20;
  width: 12px;
  height: 12px;
  margin: -6px;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: .2;
  animation: buttonRipple .58s ease-out forwards;
}
@keyframes buttonRipple { to { opacity: 0; transform: scale(18); } }

@media (hover: none), (pointer: coarse) {
  .avatar-builder::before { display: none; }
}
@media (max-width: 680px) {
  body::after { background-size: 195px 135px; opacity: .1; animation-duration: 48s; }
  .round-countdown b { font-size: 64px; }
  .rotating-slogan { min-height: 25px; margin: 10px 0 3px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  #home.active .hero-copy > *, #home.active .hero-preview, #home.active > .lobby { animation: none; }
  #home .primary::before { animation: none; display: none; }
  .rotating-slogan span { animation: none !important; }
  .home-presence i { animation: none; }
}

/* ============================================================
   DRAW ENGINE 2.0
   ============================================================ */
.draw-board { container-type: inline-size; }
.draw-toolbar { position: relative; }
.engine-badge {
  position: absolute;
  right: 9px;
  bottom: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a809b;
  font: 700 8.5px 'DM Mono', monospace;
  letter-spacing: .06em;
  pointer-events: none;
}
.engine-badge i { width: 5px; height: 5px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.color-palette { padding-right: 82px; }

.canvas-wrap {
  isolation: isolate;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(112,71,235,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112,71,235,.018) 1px, transparent 1px);
  background-size: 22px 22px;
}
.draw-board canvas { background: transparent; image-rendering: auto; }
#game.is-drawer-turn .draw-board canvas { cursor: none; }
.brush-cursor {
  position: absolute;
  z-index: 42;
  display: none;
  border: 1.5px solid rgba(24,18,39,.75);
  border-radius: 50%;
  background: color-mix(in srgb, var(--cursor-color, #1e1935) 30%, transparent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.85), 0 2px 7px rgba(27,18,47,.14);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: width .12s, height .12s, background .12s;
}
#game.is-drawer-turn .brush-cursor.show { display: block; }
.brush-cursor[data-tool="eraser"] { border-style: dashed; background: rgba(255,255,255,.78); }
.brush-cursor[data-tool="fill"] { border-radius: 7px 7px 11px 7px; transform: translate(-50%,-50%) rotate(45deg); background: var(--cursor-color); }

.btn-tool.canvas-expand { margin-left: 4px; border-color: #d9cff2; color: var(--purple); }
.btn-tool.canvas-expand.active { background: #201a31; border-color: #201a31; color: #fff; }
.btn-tool {
  transform-origin: center bottom;
  transform: translateY(var(--dock-lift, 0)) scale(var(--dock-scale, 1));
  transition: transform .16s cubic-bezier(.2,.8,.2,1), background .15s, border-color .15s, color .15s;
}
@media (hover: hover) and (pointer: fine) {
  .tools-selector .btn-tool:hover { z-index: 3; }
}

.draw-board:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 18px;
  background: linear-gradient(145deg, #f3effa, #fbfaff);
}
.draw-board:fullscreen .canvas-wrap { border-radius: 18px; }
.draw-board:fullscreen .draw-title { min-height: 44px; }
.draw-board:fullscreen .draw-toolbar { max-width: 900px; width: 100%; margin-inline: auto; }
[data-theme="dark"] .draw-board:fullscreen { background: linear-gradient(145deg, #15101d, #21182b); }
[data-theme="dark"] .engine-badge { color: #91869e; }
[data-theme="dark"] .canvas-wrap {
  background-color: #fff;
  background-image:
    linear-gradient(rgba(112,71,235,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112,71,235,.018) 1px, transparent 1px);
}

.canvas-wrap.counting-down .brush-cursor { display: none !important; }
.canvas-wrap::selection { background: transparent; }

@media (max-width: 860px) {
  .engine-badge { display: none; }
  .color-palette { padding-right: 0; }
  #game.is-drawer-turn .draw-board canvas { cursor: crosshair; }
  .brush-cursor { display: none !important; }
  .draw-board:fullscreen { padding: max(7px, env(safe-area-inset-top)) 7px max(7px, env(safe-area-inset-bottom)); }
}
