/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Animal Crossing palette ──────────────────────────────────────────────── */
:root {
  --bg:         #C8A06A;   /* sandy brown (AC background) */
  --bg-2:       #FFF8DC;   /* cream cards */
  --bg-3:       #EDD5A3;   /* warm beige */
  --bg-4:       #F5E8C0;   /* lightest cream */
  --text:       #5C3D1E;   /* dark warm brown */
  --text-2:     #8B6B4A;   /* medium brown */
  --text-3:     #B89A70;   /* light brown */
  --accent:     #6BAA6E;   /* sage green */
  --accent-hv:  #5A9460;
  --border:     #8B5E38;   /* dark brown border */
  --border-lt:  #C4965A;   /* lighter border */
  --red:        #E85050;
  --yellow:     #F5C840;
  --font:       'Nunito', 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

#three-canvas {
  position: fixed; inset: 0; display: block; z-index: 0;
}

/* ── Shake animation ──────────────────────────────────────────────────────── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.shake { animation: shake 0.42s ease; }

/* ── Shared card base ─────────────────────────────────────────────────────── */
.ac-card {
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--border), 0 12px 36px rgba(92,61,30,0.22);
}

/* ── Welcome overlay ──────────────────────────────────────────────────────── */
#welcome-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  /* needed so teacher-access-btn absolute positioning works */
}

.welcome-card {
  composes: ac-card;
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--border), 0 12px 36px rgba(92,61,30,0.22);
  padding: 40px 44px;
  width: min(420px, 92vw);
  text-align: center;
}

.welcome-logo {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 5px 18px;
  border-radius: 30px;
  border: 2.5px solid #4A8848;
  font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 18px;
}

.welcome-title {
  font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.28; margin-bottom: 6px;
}

.welcome-subtitle {
  font-size: 14px; color: var(--text-2); margin-bottom: 3px;
}
.welcome-subtitle-ar {
  font-size: 13px; color: var(--text-2); direction: rtl; margin-bottom: 22px;
}

.section-badge {
  display: inline-block;
  background: var(--bg-3);
  border: 2.5px solid var(--border);
  color: var(--text);
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  margin-bottom: 22px;
}

.login-group {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
}

.login-group label {
  font-size: 13px; font-weight: 700; color: var(--text-2);
}

.login-group input,
.login-group select {
  width: 100%; padding: 12px 16px;
  border: 3px solid var(--border-lt);
  border-radius: 16px;
  font-size: 15px; font-family: var(--font);
  background: #fff; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.login-group input:focus,
.login-group select:focus { border-color: var(--accent); }

.name-preview {
  font-size: 14px; font-weight: 700;
  color: var(--text-2);
}
.name-preview:empty { display: none; }
.name-preview.valid { color: var(--accent); }

.error-msg { font-size: 13px; color: var(--red); }
.error-msg:empty { display: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--accent);
  color: #fff;
  border: 3px solid #4A8848;
  border-radius: 30px;
  font-size: 15px; font-weight: 800; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 5px 0 #4A8848;
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover  { background: var(--accent-hv); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #4A8848; }

.btn-secondary {
  width: 100%; padding: 11px;
  background: var(--bg-3);
  color: var(--text);
  border: 3px solid var(--border);
  border-radius: 30px;
  font-size: 14px; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border);
  transition: transform .12s, box-shadow .12s;
}
.btn-secondary:hover  { background: #D8C090; }
.btn-secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border); }

.btn-link {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 13px; font-family: var(--font);
  text-decoration: underline; text-decoration-color: var(--border-lt);
}
.btn-link:hover { color: var(--text); }

.btn-logout {
  padding: 7px 14px;
  background: #fff; color: var(--text);
  border: 2.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border);
  transition: transform .12s, box-shadow .12s;
}
.btn-logout:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }

/* ── Teacher access button (welcome overlay top-right) ────────────────────── */
#teacher-access-btn {
  position: absolute;
  top: 22px; right: 24px;
  padding: 9px 18px;
  background: #3A2810;
  color: #FFF8DC;
  border: 2.5px solid #6B4520;
  border-radius: 22px;
  font-size: 13px; font-weight: 800; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 0 #1E1408;
  transition: transform .12s, box-shadow .12s;
  letter-spacing: 0.3px;
  z-index: 10;
}
#teacher-access-btn:hover  { background: #4A3418; }
#teacher-access-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1E1408; }

/* ── Teacher password modal ───────────────────────────────────────────────── */
.teacher-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,14,4,0.68);
  backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.teacher-modal-card {
  background: var(--bg-2);
  border: 4px solid #5C3A18;
  border-radius: 28px;
  box-shadow: 0 8px 0 #3A2010, 0 16px 48px rgba(40,16,0,0.35);
  padding: 40px 44px 36px;
  width: min(380px, 92vw);
  text-align: center;
}
.teacher-modal-card h2 {
  font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.teacher-modal-card p {
  font-size: 13px; color: var(--text-2); margin-bottom: 22px;
}
.teacher-modal-card input[type=password] {
  width: 100%; padding: 12px 16px;
  border: 3px solid var(--border-lt);
  border-radius: 16px;
  font-size: 15px; font-family: var(--font);
  background: #fff; color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}
.teacher-modal-card input[type=password]:focus { border-color: #8B5E38; }
.teacher-modal-error { font-size: 13px; color: var(--red); min-height: 18px; margin-bottom: 10px; }
.teacher-modal-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Teacher HUD badge ────────────────────────────────────────────────────── */
.hud-teacher-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #3A2810;
  color: #FFF8DC;
  border: 1.5px solid #6B4520;
  border-radius: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  line-height: 1.5;
}

/* ── Teacher section picker ───────────────────────────────────────────────── */
.teacher-section-card { max-width: 480px !important; }
.section-pick-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-top: 8px;
}
.section-pick-btn {
  background: var(--bg-3); border: 3px solid var(--border-lt);
  border-radius: 16px; padding: 18px 14px;
  cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.section-pick-btn:hover { border-color: #8B5E38; background: var(--bg-2); }
.section-pick-num { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.section-pick-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.section-active-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: #2D6A2D; color: #C8F0C8;
  border-radius: 10px; padding: 3px 10px;
}
.section-inactive-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: var(--bg-2); color: var(--text-2);
  border-radius: 10px; padding: 3px 10px;
}

/* ── Class list / Live boards panel ───────────────────────────────────────── */
.class-list-panel {
  position: fixed; top: 70px; right: 16px;
  width: 360px; max-height: calc(100vh - 90px);
  background: var(--bg-2); border: 3px solid var(--border-lt);
  border-radius: 18px; box-shadow: 0 8px 32px rgba(0,0,0,0.38);
  overflow-y: auto; z-index: 1500;
}
.cl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; border-bottom: 2px solid var(--border-lt);
  font-weight: 800; font-size: 14px; color: var(--text);
  position: sticky; top: 0; background: var(--bg-2); z-index: 1;
}
.cl-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 12px; }

/* Group card */
.cl-group-card { background: var(--bg-3); border-radius: 14px; overflow: hidden; }
.cl-group-loading { padding: 14px; font-size: 12px; color: var(--text-2); }
.cl-group-header {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px 8px;
  cursor: pointer; user-select: none;
  border: none; border-bottom: 1px solid var(--border-lt);
  background: transparent; text-align: left;
  border-radius: 14px 14px 0 0;
  transition: background 0.15s;
}
.cl-group-header:hover { background: rgba(200,148,74,0.18); }
.cl-group-header:active { background: rgba(200,148,74,0.30); }
.cl-group-num { font-size: 13px; font-weight: 800; color: var(--text); flex: 1; }
.cl-note-count { font-size: 11px; font-weight: 600; color: var(--text-2); }
.cl-focus-hint { font-size: 11px; color: var(--accent); font-weight: 600; }

.cl-members-row {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 12px;
}
.cl-member {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg-2); color: var(--text-2); font-weight: 600;
}
.cl-member.cl-online { background: #2D6A2D; color: #C8F0C8; }

/* HMW row */
.cl-hmw {
  margin: 0 12px 8px; padding: 7px 10px;
  background: rgba(255,248,220,0.10); border-radius: 8px;
  font-size: 12px; color: var(--text); line-height: 1.4;
}
.cl-hmw-label { font-weight: 800; color: var(--accent); margin-right: 4px; }

/* Notes grid */
.cl-no-notes { padding: 0 12px 10px; font-size: 12px; color: var(--text-2); font-style: italic; margin: 0; }
.cl-notes-grid {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px;
}
.cl-note-chip {
  border-radius: 8px; padding: 6px 9px;
  min-width: 80px; max-width: 160px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.cl-note-author { font-size: 10px; opacity: 0.7; margin-bottom: 2px; font-weight: 700; }
.cl-note-text { font-size: 12px; font-weight: 600; line-height: 1.35; word-break: break-word; }

/* Legacy rows (kept for compatibility) */
.cl-group-row { background: var(--bg-3); border-radius: 12px; padding: 10px 12px; }
.cl-group-label { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.cl-members { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Group confirmation overlay ───────────────────────────────────────────── */
#group-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(139,94,56,0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
}

.confirm-card {
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--border), 0 14px 40px rgba(92,61,30,0.25);
  padding: 36px 40px;
  width: min(460px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
}

.confirm-card h2 {
  font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 8px;
}
.confirm-card p { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }

.group-badge {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-3);
  border: 3px solid var(--border-lt);
  border-radius: 20px;
  padding: 14px 20px;
  margin-bottom: 18px;
}

.badge-number {
  font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1;
}

.badge-label {
  font-size: 14px; font-weight: 700; color: var(--text-2); line-height: 1.4;
}

.members-list {
  list-style: none; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px;
}
.members-list li {
  padding: 9px 14px;
  background: var(--bg-4);
  border: 2px solid var(--border-lt);
  border-radius: 14px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.members-list li.me {
  background: var(--accent);
  border-color: #4A8848;
  color: #fff;
}

.group-row {
  padding: 10px 14px;
  background: var(--bg-4);
  border: 2px solid var(--border-lt);
  border-radius: 14px;
  margin-bottom: 4px;
}
.group-row.my-group {
  background: var(--bg-3);
  border-color: var(--accent);
}
.group-row-header { font-weight: 800; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.group-row-members { font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px; }
.group-row-members span {
  background: var(--bg-3);
  padding: 2px 8px; border-radius: 8px;
  border: 1.5px solid var(--border-lt);
}

.confirm-card details summary {
  cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2);
  padding: 8px 0; user-select: none;
}

.confirm-actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 20px;
}

/* ── HUD ──────────────────────────────────────────────────────────────────── */
#hud {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 40px;
  padding: 8px 12px;
  box-shadow: 0 6px 0 var(--border), 0 10px 24px rgba(92,61,30,0.20);
  z-index: 50;
  white-space: nowrap;
}

.hud-left  { display: flex; align-items: center; gap: 8px; padding-right: 8px; border-right: 2px solid var(--border-lt); }
.hud-center{ display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.hud-right { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 2px solid var(--border-lt); }

.hud-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-3);
  border: 2.5px solid var(--border);
}

.hud-name  { font-size: 14px; font-weight: 800; color: var(--text); display: block; }
.hud-group { font-size: 12px; font-weight: 600; color: var(--text-2); display: block; }

.hud-btn {
  padding: 8px 14px;
  background: var(--bg-3);
  color: var(--text);
  border: 2.5px solid var(--border);
  border-radius: 22px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border);
  transition: transform .1s, box-shadow .1s;
  white-space: nowrap;
}
.hud-btn:hover  { background: #D8C090; }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }

.hud-btn.locked {
  opacity: 0.50; cursor: not-allowed; pointer-events: none;
  background: var(--bg-4);
}

/* ── Modal overlay ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(139,94,56,0.50);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 800;
}

.modal-inner {
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 6px 0 var(--border), 0 10px 32px rgba(92,61,30,0.22);
  padding: 32px 36px;
  width: min(420px, 90vw);
}

.modal-inner h3 {
  font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 10px;
}
.modal-inner p {
  font-size: 14px; color: var(--text-2); margin-bottom: 8px;
}
.modal-inner p.ar { direction: rtl; font-size: 13px; margin-bottom: 18px; }

.modal-inner select {
  width: 100%; padding: 10px 14px; margin-bottom: 16px;
  border: 3px solid var(--border-lt); border-radius: 16px;
  font-size: 14px; font-family: var(--font); color: var(--text);
  background: var(--bg-4); outline: none;
}

.modal-actions {
  display: flex; gap: 10px; margin-top: 16px;
}

/* Code entry modal */
.code-entry .code-input {
  width: 100%; padding: 16px; text-align: center;
  font-size: 32px; font-weight: 800; letter-spacing: 12px;
  border: 3px solid var(--border-lt); border-radius: 18px;
  background: var(--bg-4); color: var(--text); outline: none;
  font-family: monospace; margin-bottom: 4px;
}
.code-entry .code-input:focus { border-color: var(--accent); }

/* ── Board overlay (analysis + sticky board) ──────────────────────────────── */
.board-overlay {
  position: fixed; inset: 0;
  background: rgba(139,94,56,0.45);
  backdrop-filter: blur(12px) saturate(1.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 700;
  padding: 16px;
}

/* Analysis board */
.analysis-board {
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--border), 0 14px 44px rgba(92,61,30,0.22);
  padding: 32px 36px;
  width: min(840px, 98vw);
  max-height: 90vh;
  overflow-y: auto;
}

.analysis-board h2 {
  font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px;
}
.analysis-board .board-subtitle {
  font-size: 14px; color: var(--text-2); margin-bottom: 22px;
}

.question-block {
  background: var(--bg-4);
  border: 2.5px solid var(--border-lt);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.question-block label {
  display: block; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}

.question-block textarea,
.question-block input[type="text"] {
  width: 100%; padding: 10px 14px;
  border: 2.5px solid var(--border-lt); border-radius: 14px;
  font-size: 14px; font-family: var(--font); color: var(--text);
  background: #fff; resize: vertical; outline: none;
  transition: border-color .2s;
}
.question-block textarea:focus,
.question-block input[type="text"]:focus { border-color: var(--accent); }

.board-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}
.board-close-btn {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-2); font-family: var(--font); font-weight: 700;
  padding: 4px 8px;
}

/* ── Sticky board ─────────────────────────────────────────────────────────── */
.sticky-board {
  background: var(--bg);
  border: 4px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 7px 0 var(--border), 0 14px 44px rgba(92,61,30,0.22);
  padding: 24px 28px;
  width: min(960px, 98vw);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.sticky-board h2 {
  font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 16px;
}

.notes-grid {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 0;
  min-height: 140px;
}

/* Sticky note card */
.sticky-note {
  width: 170px; min-height: 150px;
  border-radius: 18px;
  padding: 14px 14px 10px;
  box-shadow: 0 4px 0 rgba(92,61,30,0.22), 0 6px 16px rgba(92,61,30,0.14);
  cursor: grab; position: relative; user-select: none;
  border: 2px solid rgba(0,0,0,0.08);
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.sticky-note:hover    { transform: scale(1.04) rotate(-1deg); box-shadow: 0 8px 0 rgba(92,61,30,0.22); }
.sticky-note.dragging { transform: scale(1.08) rotate(2deg); z-index: 200; box-shadow: 0 16px 32px rgba(92,61,30,0.30); cursor: grabbing; }

.sticky-note .note-author { font-size: 11px; font-weight: 800; opacity: 0.65; }
.sticky-note .note-text   { font-size: 14px; font-weight: 600; flex: 1; line-height: 1.4; }
.sticky-note .note-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.12); border: none; border-radius: 50%;
  width: 20px; height: 20px; cursor: pointer;
  font-size: 12px; line-height: 20px; text-align: center; color: #fff;
  display: none;
}
.sticky-note:hover .note-delete { display: block; }

/* Color palette: AC pastel */
.note-color-0 { background: #FFD93D; color: #5C3D1E; }
.note-color-1 { background: #FF9BB5; color: #5C1A2A; }
.note-color-2 { background: #9BCFB8; color: #1A3A2A; }
.note-color-3 { background: #A5C8FF; color: #1A2A5C; }

.add-note-btn {
  width: 170px; min-height: 150px;
  border-radius: 18px;
  border: 3px dashed var(--border-lt);
  background: transparent;
  color: var(--text-2);
  font-size: 34px; font-weight: 300;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.add-note-btn:hover { background: var(--bg-4); border-color: var(--border); color: var(--text); }

/* Color picker row */
.color-picker-row {
  display: flex; gap: 8px; align-items: center; margin: 6px 0;
}
.color-dot {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform .1s;
}
.color-dot.active, .color-dot:hover { transform: scale(1.2); border-color: var(--border); }

/* ── WallPicker ───────────────────────────────────────────────────────────── */
.wall-picker {
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 7px 0 var(--border), 0 12px 36px rgba(92,61,30,0.22);
  padding: 28px 32px;
  width: min(580px, 92vw);
  max-height: 80vh; overflow-y: auto;
}

.wall-picker h3 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.wall-picker p  { font-size: 14px; color: var(--text-2); margin-bottom: 18px; }

.zone-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px;
}

.zone-btn {
  padding: 14px 8px;
  background: var(--bg-4);
  border: 3px solid var(--border-lt);
  border-radius: 18px;
  font-size: 14px; font-weight: 700; font-family: var(--font);
  color: var(--text); cursor: pointer; text-align: center;
  box-shadow: 0 4px 0 var(--border-lt);
  transition: transform .1s, box-shadow .1s, background .1s;
}
.zone-btn:hover  { background: var(--bg-3); border-color: var(--border); }
.zone-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border-lt); }
.zone-btn.taken  { opacity: 0.45; pointer-events: none; background: var(--bg-3); }

.zone-btn .zone-name  { font-size: 16px; font-weight: 800; color: var(--accent); }
.zone-btn .zone-wall  { font-size: 11px; color: var(--text-2); margin-top: 3px; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--text);
  color: var(--bg-2);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px; font-weight: 700;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(92,61,30,0.28);
  transition: opacity .5s;
  white-space: nowrap;
}

/* ── Guest button ────────────────────────────────────────────────────────── */
.btn-guest {
  width: 100%; height: 46px;
  background: transparent;
  border: 2.5px solid var(--border-lt);
  border-radius: 30px;
  color: var(--text-2);
  font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  transition: background .15s, color .15s;
}
.btn-guest:hover { background: var(--bg-3); color: var(--text); }

/* ── Crosshair (always visible in 3D view) ───────────────────────────────── */
#crosshair {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 20px; height: 20px;
  pointer-events: none; z-index: 600;
  display: none;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: rgba(255,255,255,0.80);
  border-radius: 2px; box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
#crosshair::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
#crosshair::after  { width: 100%; height: 2px; top: 50%; transform: translateY(-50%); }
body.in-classroom #crosshair { display: block; }

/* ── Drag hint (shown briefly on first entry) ────────────────────────────── */
#drag-hint {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(92,61,30,0.75); color: #FFF8DC;
  padding: 8px 20px; border-radius: 20px;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  pointer-events: none; z-index: 700;
  transition: opacity 1s;
}

/* ── Ideas Panel (small left-side panel) ─────────────────────────────────── */
.ideas-panel {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  width: 270px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 3px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--border), 0 10px 30px rgba(92,61,30,0.25);
  z-index: 500;
  font-family: var(--font);
}
.ideas-panel-inner { padding: 16px 18px; }
.ideas-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 800; color: var(--text);
  margin-bottom: 14px;
}
.btn-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--border-lt);
  color: var(--text-2); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 700;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--bg-4); color: var(--text); }
.hmw-section { margin-bottom: 12px; }
.hmw-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-2); margin-bottom: 6px; line-height: 1.5;
}
.ar-small { font-size: 11px; direction: rtl; display: block; }
.hmw-input {
  width: 100%; height: 68px;
  border: 2px solid var(--border-lt); border-radius: 10px;
  background: var(--bg-4); color: var(--text);
  font-family: var(--font); font-size: 13px; padding: 8px 10px;
  resize: none; margin-bottom: 8px;
}
.hmw-input:focus { outline: none; border-color: var(--accent); }
.btn-small-green {
  width: 100%; height: 36px;
  background: var(--accent); color: #fff;
  border: 2px solid #4A8848; border-radius: 20px;
  box-shadow: 0 3px 0 #4A8848;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.btn-small-green:active { transform: translateY(2px); box-shadow: 0 1px 0 #4A8848; }
.divider { height: 1px; background: var(--border-lt); margin: 10px 0; }
.note-section {}
.note-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.color-row { display: flex; gap: 8px; margin-bottom: 10px; }
.color-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  transition: transform .15s;
}
.color-dot.active { border-color: var(--text); transform: scale(1.15); }
.btn-add-note {
  width: 100%; height: 38px;
  background: var(--bg-3); border: 2.5px solid var(--border-lt);
  border-radius: 20px; box-shadow: 0 3px 0 var(--border-lt);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  color: var(--text); cursor: pointer;
}
.btn-add-note:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border-lt); }

/* ── Note edit popup ─────────────────────────────────────────────────────── */
/* ── Big sticky note editor (full-screen immersive) ──────────────────────── */
.note-edit-fullscreen {
  position: fixed; inset: 0;
  background: rgba(20,10,0,0.75);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
}

.note-edit-big {
  position: relative;
  width: min(460px, 90vw);
  min-height: 460px;
  border-radius: 6px 6px 6px 4px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.22), 0 20px 60px rgba(0,0,0,0.55);
  padding: 28px 32px 26px;
  display: flex; flex-direction: column;
}
.note-edit-big::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 40px 40px;
  border-color: transparent transparent rgba(0,0,0,0.16) transparent;
}

.note-edit-pin {
  width: 22px; height: 22px;
  background: radial-gradient(circle at 38% 32%, #FF7070, #C0392B);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.40);
  margin: 0 auto 18px;
  position: relative;
}
.note-edit-pin::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: 7px; height: 7px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
}

.note-edit-textarea {
  flex: 1;
  width: 100%;
  min-height: 320px;
  background: transparent;
  border: none; outline: none; resize: none;
  font-family: var(--font);
  font-size: 24px;
  line-height: 1.55;
  padding: 0;
}
.note-edit-textarea::placeholder { opacity: 0.38; }

.note-edit-big-actions {
  display: flex; gap: 10px; margin-top: 22px; align-items: center;
}

.btn-post-note {
  flex: 1; padding: 13px;
  background: rgba(0,0,0,0.15);
  border: 2.5px solid;
  border-radius: 26px;
  font-size: 15px; font-weight: 800; font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-post-note:hover { background: rgba(0,0,0,0.26); }

.btn-discard-note {
  padding: 11px 16px;
  background: transparent;
  border: 2px solid;
  border-radius: 22px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; opacity: 0.65;
  transition: opacity 0.15s;
}
.btn-discard-note:hover { opacity: 1; }

/* ── Export board button ──────────────────────────────────────────────────── */
.btn-export-board {
  width: 100%; padding: 11px;
  background: var(--bg-3);
  color: var(--text);
  border: 2.5px solid var(--border);
  border-radius: 22px;
  font-size: 13px; font-weight: 800; font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border);
  transition: transform .1s, box-shadow .1s;
  margin-top: 4px;
}
.btn-export-board:hover  { background: #D8C090; }
.btn-export-board:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }

.note-edit-actions { display: flex; gap: 8px; }
.btn-small-red {
  flex: 1; height: 34px; background: #E85050; color: #fff;
  border: 2px solid #C04040; border-radius: 16px;
  font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-small-red:hover { background: #C04040; }
.note-edit-actions .btn-small-green { flex: 1; height: 34px; }

/* ── Scrollbar (AC warm) ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-4); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ── Mobile virtual D-pad ─────────────────────────────────────────────────── */
#mobile-dpad {
  display: none;
  position: fixed;
  bottom: 90px; left: 16px;
  width: 110px; height: 110px;
  z-index: 900;
  pointer-events: none;
}
.dpad-btn {
  position: absolute;
  width: 36px; height: 36px;
  background: rgba(255,248,220,0.82);
  border: 2.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; pointer-events: all;
  box-shadow: 0 3px 0 var(--border);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dpad-btn:active { transform: translateY(2px); box-shadow: none; }
.dpad-up    { top: 0;    left: 37px; }
.dpad-down  { bottom: 0; left: 37px; }
.dpad-left  { top: 37px; left: 0;    }
.dpad-right { top: 37px; right: 0;   }

#mobile-interact {
  display: none;
  position: fixed;
  bottom: 90px; right: 16px;
  padding: 10px 16px;
  background: rgba(255,248,220,0.82);
  border: 2.5px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 12px; font-weight: 700; font-family: var(--font);
  box-shadow: 0 3px 0 var(--border);
  z-index: 900;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── Mobile / Phone layout (≤640px) ──────────────────────────────────────── */
@media (max-width: 640px) {

  /* Show D-pad on touch devices */
  #mobile-dpad, #mobile-interact { display: block; }

  /* Welcome card — less padding, smaller font */
  .welcome-card {
    padding: 28px 22px;
    border-radius: 22px;
    width: 94vw;
  }
  .welcome-title  { font-size: 22px; }
  .welcome-logo   { margin-bottom: 12px; }
  .welcome-subtitle { font-size: 13px; }
  .welcome-subtitle-ar { margin-bottom: 14px; }
  #teacher-access-btn { top: 14px; right: 14px; padding: 7px 12px; font-size: 12px; }

  /* HUD — full-width strip at bottom */
  #hud {
    bottom: 0;
    left: 0; right: 0;
    transform: none;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  #hud::-webkit-scrollbar { display: none; }
  .hud-left  { padding-right: 6px; flex-shrink: 0; }
  .hud-right { padding-left: 6px; flex-shrink: 0; }
  .hud-center{ gap: 5px; flex-shrink: 0; }
  .hud-btn   { font-size: 11px; padding: 6px 10px; flex-shrink: 0; }
  .hud-name  { font-size: 12px; }
  .hud-group { font-size: 10px; }
  .hud-avatar{ width: 24px; height: 24px; }
  .btn-logout{ font-size: 11px; padding: 5px 10px; }

  /* D-pad lifts above HUD bar */
  #mobile-dpad    { bottom: 72px; }
  #mobile-interact{ bottom: 72px; }

  /* Hide D-pad when the ideas board panel is open */
  body.board-open #mobile-dpad,
  body.board-open #mobile-interact { display: none !important; }

  /* Toast lifts above HUD */
  .toast { bottom: 72px; }
  #drag-hint { bottom: 72px; }

  /* Ideas panel → full-width bottom sheet */
  .ideas-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    transform: none;
    border-radius: 24px 24px 0 0;
    max-height: 68vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  /* Drag handle pill */
  .ideas-panel::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border-lt);
    border-radius: 4px;
    margin: 10px auto 0;
  }

  /* Class list panel → full-width bottom sheet */
  .class-list-panel {
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 70vh;
  }

  /* Note editor — fit on mobile screen */
  .note-edit-big {
    width: 96vw;
    min-height: 0;
    padding: 20px 18px 18px;
  }
  .note-edit-textarea {
    min-height: 220px;
    font-size: 20px;
  }
  .note-edit-big-actions { margin-top: 14px; }
  .btn-post-note  { font-size: 14px; padding: 11px; }
  .btn-discard-note { font-size: 12px; padding: 9px 12px; }

  /* Group confirm card */
  .confirm-card { padding: 24px 18px; }
  #group-confirm-overlay .confirm-card { width: 96vw; }

  /* Teacher modal */
  .teacher-modal-card { padding: 24px 20px; width: 94vw; }
  .teacher-section-card { max-width: 94vw !important; }
  .section-pick-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Teacher board view panel → bottom sheet on mobile */
  #teacher-board-view-panel {
    position: fixed;
    top: auto; bottom: 0;
    left: 0; right: 0;
    width: 100%;
    transform: none;
    border-radius: 24px 24px 0 0;
    max-height: 70vh;
    overflow-y: auto;
  }
  #teacher-board-view-panel::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border-lt);
    border-radius: 4px;
    margin: 10px auto 0;
  }

  /* Hide crosshair on mobile — replaced by tap */
  #crosshair { display: none !important; }
}

/* ── Tablet (641–900px) ───────────────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 900px) {
  .ideas-panel { width: 300px; }
  #hud {
    padding: 8px 10px;
    gap: 6px;
  }
  .hud-btn { font-size: 12px; padding: 7px 11px; }
}

/* ── Vote Panel — Board View ─────────────────────────────────────────────── */
#vote-panel-overlay {
  position: fixed; inset: 0; z-index: 3000;
  /* Cork board aesthetic — matches the 3D classroom boards */
  background:
    radial-gradient(ellipse at 22% 28%, rgba(255,220,140,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 78% 72%, rgba(120,65,20,0.22) 0%, transparent 55%),
    linear-gradient(155deg, #C8904A 0%, #A06830 45%, #7A4E22 100%);
  overflow-y: auto; overflow-x: hidden;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 0 50px;
}

.vp-inner {
  width: 100%; max-width: 1200px;
  padding: 0 28px;
}

/* Header strip */
.vp-header {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 28px 16px;
  margin: 0 -28px 28px;
  background: rgba(30,12,2,0.62);
  border-bottom: 2px solid rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
}

.vp-back-btn {
  background: rgba(255,248,220,0.18);
  color: #FFF8DC; border: 2px solid rgba(255,248,220,0.35);
  border-radius: 24px; padding: 8px 18px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s;
}
.vp-back-btn:hover { background: rgba(255,248,220,0.32); }

.vp-title-block h2 {
  color: #FFF8DC; font-size: 22px; font-weight: 800;
  margin: 0 0 3px; text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.vp-title-block p {
  color: rgba(255,248,220,0.65); font-size: 13px; margin: 0;
}

/* Smiley token tray */
.vp-tray {
  background: rgba(0,0,0,0.22);
  border: 2px dashed rgba(255,248,220,0.32);
  border-radius: 18px; padding: 14px 18px;
  margin-bottom: 30px; min-height: 82px;
  transition: background 0.15s, border-color 0.15s;
}
.vp-tray.drag-over {
  background: rgba(0,0,0,0.38);
  border-color: rgba(255,248,220,0.75);
}
.vp-tray-label {
  color: rgba(255,248,220,0.55); font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 10px;
}
.vp-tokens-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* Tokens (draggable smileys in tray) */
.vp-token {
  width: 52px; height: 52px; cursor: grab;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.45));
  transition: transform 0.12s, filter 0.12s;
  user-select: none; flex-shrink: 0;
}
.vp-token svg { width: 52px; height: 52px; display: block; }
.vp-token:hover { transform: scale(1.16); filter: drop-shadow(0 5px 16px rgba(0,0,0,0.55)); }
.vp-token.dragging { opacity: 0.3; }

/* Smaller tokens placed directly on sticky notes */
.vp-token.vp-token-sm { width: 40px; height: 40px; }
.vp-token.vp-token-sm svg { width: 40px; height: 40px; }

/* Board-view notes grid */
.vp-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.vp-empty {
  color: rgba(255,248,220,0.45); font-size: 16px;
  text-align: center; padding: 70px 0; grid-column: 1/-1;
}

/* Note card: pin + sticky note with smileys overlaid on it */
.vp-note-card {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: transform 0.14s;
}
.vp-note-card:hover { transform: translateY(-4px); }

.vp-note-pin-dot {
  width: 16px; height: 16px; flex-shrink: 0;
  background: radial-gradient(circle at 38% 33%, #FF9090 0%, #CC2828 75%);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0,0,0,0.55);
  margin-bottom: -9px; z-index: 1; position: relative;
}

.vp-note-sticky {
  position: relative; width: 100%;
  padding: 14px 14px 56px 14px;
  min-height: 155px;
  border-radius: 3px 3px 5px 5px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.38), 0 1px 0 rgba(255,255,255,0.12) inset,
              3px 0 6px rgba(0,0,0,0.08);
  transition: box-shadow 0.14s;
}
.vp-note-card.drag-over .vp-note-sticky {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.75),
              0 6px 20px rgba(0,0,0,0.38);
}

.vp-note-author {
  font-size: 11px; font-weight: 700;
  opacity: 0.55; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.vp-note-hr {
  border: none; border-top: 1px solid currentColor;
  opacity: 0.15; margin: 0 0 9px;
}
.vp-note-text {
  font-size: 16px; font-weight: 700; line-height: 1.45;
  word-break: break-word;
}

/* Smiley tokens overlaid at the bottom-right of the note */
.vp-note-smiley-overlay {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: flex-end; align-items: flex-end;
  min-height: 44px; pointer-events: none;
}
.vp-note-smiley-overlay .vp-token { pointer-events: all; }

.vp-drop-cue {
  font-size: 10px; opacity: 0.38; font-style: italic;
  user-select: none; align-self: flex-end; pointer-events: none;
  padding-bottom: 2px;
}

/* Vote button in teacher board view panel */
.btn-vote-open {
  display: block; width: 100%;
  background: rgba(255,255,255,0.22);
  color: var(--text); border: 2px solid rgba(255,255,255,0.55);
  border-radius: 14px;
  padding: 10px 0; font-family: var(--font);
  font-size: 14px; font-weight: 800; cursor: pointer;
  margin: 0 0 12px; letter-spacing: .02em;
  backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s;
}
.btn-vote-open:hover { background: rgba(255,255,255,0.36); border-color: rgba(255,255,255,0.8); }

/* Vote button in class list card */
.cl-vote-btn {
  display: block; width: calc(100% - 16px); margin: 6px 8px 8px;
  background: rgba(255,255,255,0.22);
  color: var(--text); border: 2px solid rgba(255,255,255,0.55);
  border-radius: 10px;
  padding: 7px 0; font-family: var(--font);
  font-size: 12px; font-weight: 800; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s;
}
.cl-vote-btn:hover { background: rgba(255,255,255,0.36); border-color: rgba(255,255,255,0.8); }

/* Switch-voter button in vote panel header */
.vp-switch-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(255,248,220,0.15); border: 2px solid rgba(255,248,220,0.3);
  border-radius: 14px; padding: 6px 12px; cursor: pointer; flex-shrink: 0;
  font-family: var(--font); color: rgba(255,248,220,0.8);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  transition: background 0.15s;
}
.vp-switch-btn svg { width: 38px; height: 38px; display: block; }
.vp-switch-btn:hover { background: rgba(255,248,220,0.28); }

/* Color picker step */
.vp-color-picker-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 0 40px;
}
.vp-color-instructions {
  color: rgba(255,248,220,0.7); font-size: 15px; font-weight: 600;
  text-align: center; line-height: 1.6; margin-bottom: 32px;
}
.vp-color-grid {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
  max-width: 600px;
}
.vp-color-choice {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1); border: 3px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 18px 16px 12px;
  cursor: pointer; transition: transform 0.13s, background 0.13s, border-color 0.13s;
  min-width: 90px;
}
.vp-color-choice:hover { transform: translateY(-4px); background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.vp-color-choice.selected { border-color: #fff; background: rgba(255,255,255,0.28); transform: translateY(-4px); }
.vp-color-smiley svg { width: 64px; height: 64px; display: block; }
.vp-color-choice span {
  color: rgba(255,248,220,0.85); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  font-family: var(--font);
}

/* Own vote token on a note (draggable ring) */
.vp-token-own { outline: 2px solid rgba(255,255,255,0.7); border-radius: 50%; cursor: grab; }

/* Vote detail popup — shown when clicking a note in vote panel */
.vp-detail-popup {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.68);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.vp-detail-inner {
  background: #1A1220;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 28px 30px;
  max-width: 380px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  text-align: center;
}
.vp-detail-note {
  border-radius: 10px; padding: 14px 18px;
  margin-bottom: 18px; text-align: left;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.vp-detail-author {
  font-size: 11px; font-weight: 700; opacity: 0.55;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.vp-detail-text {
  font-size: 17px; font-weight: 700; line-height: 1.45;
}
.vp-detail-label {
  color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 16px;
}
.vp-detail-smileys {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; margin-bottom: 24px;
}
.vp-detail-smiley-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.vp-detail-smiley-item svg { width: 48px; height: 48px; }
.vp-detail-smiley-item span {
  font-size: 10px; color: rgba(255,255,255,0.45); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.vp-detail-close {
  background: rgba(255,255,255,0.1); color: #fff;
  border: 2px solid rgba(255,255,255,0.2); border-radius: 20px;
  padding: 9px 30px; font-family: var(--font);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.vp-detail-close:hover { background: rgba(255,255,255,0.2); }

/* ── Guest onboarding card ─────────────────────────────────────────────────── */
#onboarding-card {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  width: min(320px, calc(100vw - 32px));
  background: var(--bg-2);
  border: 4px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 6px 0 var(--border), 0 12px 30px rgba(92,61,30,0.25);
  padding: 18px 22px 20px;
  z-index: 600;
  font-family: var(--font); color: var(--text);
}
#onboarding-card .ob-step { font-size: 12px; font-weight: 700; color: var(--text-3); }
#onboarding-card h3 { font-size: 20px; font-weight: 800; margin: 4px 0 2px; }
#onboarding-card p { font-size: 14px; line-height: 1.45; color: var(--text-2); margin-bottom: 14px; }
#onboarding-card .ob-ar { direction: rtl; font-size: 13px; margin-bottom: 8px; }
.ob-highlight {
  outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 12px;
  animation: ob-pulse 1.2s ease-in-out infinite;
}
@keyframes ob-pulse { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .ob-highlight { animation: none; } }
@media (max-width: 640px) {
  #onboarding-card { top: 12px; left: 16px; right: 16px; width: auto; transform: none; padding: 14px 16px 16px; }
  #onboarding-card h3 { font-size: 17px; }
  #onboarding-card p { font-size: 13px; margin-bottom: 10px; }
}
