@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;900&family=Rubik:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0');

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

:root {
  --bg:       #FFFEF5;
  --surface:  #F0EDD8;
  --card:     #FFFFFF;
  --text:     #111111;
  --muted:    #444444;
  --red:      #EF3340;
  --blue:     #2563EB;
  --green:    #16A34A;
  --yellow:   #D97706;
  --accent:   #0F766E;
  --radius:   12px;
  --radius-lg: 18px;
  --border:   2px solid #111111;
  --shadow:   0 3px 0px rgba(0,0,0,0.75);
  --shadow-lg: 0 5px 0px rgba(0,0,0,0.75);

  --text-display: 2.2rem;
  --text-title:   1.75rem;
  --text-sub:     1.25rem;
  --text-body:    1rem;
  --text-meta:    0.875rem;
  --text-caption: 0.8rem;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', 'Rubik', sans-serif;
  direction: rtl;
  overflow: hidden;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 24px;
  gap: 16px;
  text-align: center;
  background: var(--bg);
  position: relative;
}
.screen.active { display: flex; }

h1 { font-size: 2.4rem; font-weight: 900; color: var(--text); letter-spacing: -1px; }
.welcome-logo { max-width: 198px; width: 100%; }
h2 { font-size: var(--text-title); font-weight: 900; color: var(--text); }
h3 { font-size: var(--text-meta); font-weight: 700; color: var(--text); }
.welcome-subtitle { font-size: var(--text-sub); font-weight: 400; color: var(--muted); }
p, label { color: var(--muted); font-size: var(--text-body); }

/* Buttons */
button {
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: 700;
  border: var(--border);
  border-radius: var(--radius);
  padding: 10px 24px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--shadow);
}
button:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; transform: none; }
button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-ghost     { background: transparent; color: var(--text); border: var(--border); box-shadow: 0 2px 0px rgba(0,0,0,0.6); }
.btn-tertiary  { background: var(--bg); color: var(--text); border: none; box-shadow: none; }
.btn-screen-exit {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  padding: 4px;
  min-height: unset;
  line-height: 1;
}

.btn-danger    { background: var(--red); color: #fff; }
.btn-success   { background: var(--green); color: #fff; }
.btn-icon      { padding: 4px 10px; border-radius: 8px; font-size: var(--text-caption); box-shadow: 0 2px 0px rgba(0,0,0,0.7); }
.btn-red       { background: var(--red);  color: #fff; padding: 10px 16px; font-size: var(--text-caption); border-radius: 8px; box-shadow: 0 2px 0px rgba(0,0,0,0.8); }
.btn-blue      { background: var(--blue); color: #fff; padding: 10px 16px; font-size: var(--text-caption); border-radius: 8px; box-shadow: 0 2px 0px rgba(0,0,0,0.8); }
.btn-team      { margin-right: 6px; }

/* Inputs */
input[type="text"],
input[type="email"] {
  font-family: inherit;
  font-size: var(--text-body);
  background: var(--card);
  color: var(--text);
  border: var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  width: 100%;
  max-width: 360px;
  outline: none;
  direction: rtl;
  transition: box-shadow 0.12s, border-color 0.12s;
  box-shadow: 0 2px 0px rgba(0,0,0,0.6);
}
input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 3px 0px var(--accent);
}

.no-game-beta   { font-size: var(--text-caption); color: var(--muted); max-width: 300px; text-align: center; line-height: 1.6; }
.waitlist-form  { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 320px; margin-top: 8px; }

/* Card */
.card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

/* Timer */
.timer {
  font-size: var(--text-title);
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  background: var(--card);
  border: var(--border);
  border-radius: 16px;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}
.timer-urgent { color: var(--red); border-color: var(--red); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.35; } }

/* Round during / viewer — top bar layout */
#screen-round-during,
#screen-viewer {
  justify-content: space-between;
  padding: 20px 24px 32px;
}

/* Round last word — card stays fixed, everything else absolute */
#screen-round-last-word {
  position: relative;
  justify-content: center;
  padding: 20px 24px 32px;
}
#screen-round-last-word > .round-during-top {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  max-width: none;
  width: auto;
}
#last-word-title {
  position: absolute;
  top: 72px;
  bottom: 50%;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sub);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.last-word-bottom {
  position: absolute;
  bottom: 32px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.round-during-top {
  width: 100%;
  max-width: 380px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.round-during-top .score-line {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
}
.round-during-bottom {
  display: flex;
  gap: 16px;
}
.timer-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.timer-ring {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.timer-ring-track {
  fill: none;
  stroke: var(--surface);
  stroke-width: 7;
}
.timer-ring-progress {
  fill: none;
  stroke: var(--text);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 263.89;
  stroke-dashoffset: 0;
  transition: stroke 0.3s, stroke-dashoffset 0.2s linear;
}
.timer-ring-progress.urgent { stroke: var(--red); }
.timer-wrapper .timer {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: auto; height: auto;
  border: none;
  box-shadow: none;
  background: transparent;
  font-size: var(--text-body);
  border-radius: 0;
  letter-spacing: -1px;
}

/* Word card */
.word-card {
  background: var(--card);
  color: var(--text);
  border: 3px solid #111;
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  font-size: var(--text-display);
  font-weight: 900;
  width: 100%;
  max-width: 380px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0px rgba(0,0,0,0.75);
  letter-spacing: -0.5px;
}
.blurred { filter: blur(12px); user-select: none; }
.word-placeholder { color: var(--muted); }

/* Word feedback badge */
.feedback-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: var(--text-title);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #111;
}
.feedback-badge.success { background: var(--green); color: #fff; }
.feedback-badge.fail    { background: var(--red);   color: #fff; }

.word-card.feedback-success { border-color: var(--green); }
.word-card.feedback-fail    { border-color: var(--red); }

/* Word card + feedback badge container */
.word-card-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding-top: 48px;
}
#round-feedback-badge,
#last-feedback-badge,
#viewer-feedback-badge {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  width: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 3px solid #111;
  border-bottom: none;
  font-size: var(--text-title);
}
.word-card-container.has-feedback .word-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

/* Score line */
.score-line { font-size: var(--text-meta); font-weight: 700; color: var(--muted); }
.score-icon-success { color: var(--green); }
.score-icon-fail    { color: var(--red); }

/* Lobby teams */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}
.team-col h3 { font-size: var(--text-meta); font-weight: 700; margin-bottom: 8px; }
.team-col.red h3  { color: var(--red); }
.team-col.blue h3 { color: var(--blue); }
.team-col ul { list-style: none; }
.team-col li { padding: 4px 0; font-size: var(--text-meta); color: var(--text); }
.team-col li.disconnected { opacity: 0.4; }
.team-name-red  { color: var(--text); }
.team-name-blue { color: var(--text); }

.unassigned-list { list-style: none; width: 100%; max-width: 420px; }
.unassigned-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 2px solid var(--surface);
  color: var(--text);
}

/* Lobby fixed actions */
#screen-lobby {
  position: relative;
  padding-bottom: 150px;
}
.lobby-actions {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lobby-btn-full { width: 100%; max-width: 380px; }
.lobby-btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}
.lobby-btn-row button { flex: 1; height: 44px; }
.lobby-btn-icon {
  flex: 0 0 48px !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  font-weight: normal;
  font-style: normal;
  user-select: none;
}
.lobby-btn-icon .material-symbols-rounded {
  font-size: 22px;
  display: block;
  line-height: 22px;
  height: 22px;
}

/* Lobby meta labels */
.lobby-meta    { font-size: var(--text-caption); color: var(--muted); opacity: 0.8; }
.lobby-warning { font-size: var(--text-caption); color: var(--muted); opacity: 0.7; }
.lobby-error   { font-size: var(--text-caption); color: var(--red); margin-top: 4px; }
.lobby-few-words-warning { font-size: var(--text-caption); color: var(--yellow); font-weight: 700; text-align: center; }
.lobby-no-words-warning  { font-size: var(--text-caption); color: var(--yellow); font-weight: 700; text-align: center; }
.drawer-title  { font-size: var(--text-body); font-weight: 700; color: var(--text); margin-bottom: 4px; }
.drawer-buttons { display: flex; gap: 10px; margin-top: 12px; }
.drawer-buttons button { flex: 1; }

/* Words screen */
.words-list { list-style: none; width: 100%; max-width: 420px; overflow-y: auto; max-height: 50vh; }
.word-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid var(--surface);
  font-size: var(--text-body);
  color: var(--text);
}
.words-empty { color: var(--muted); padding: 16px 0; }

/* Config selects */
select {
  font-family: inherit;
  font-size: var(--text-body);
  background: var(--card);
  color: var(--text);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  direction: rtl;
  outline: none;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 2px 0px rgba(0,0,0,0.6);
  transition: box-shadow 0.12s, border-color 0.12s;
}
select:focus { border-color: var(--accent); box-shadow: 0 3px 0px var(--accent); }

/* Bottom drawer */
.bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: var(--border);
  border-left: var(--border);
  border-right: var(--border);
  border-radius: 20px 20px 0 0;
  padding: 12px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 200;
  transform: translateY(100%);
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.bottom-drawer.open { transform: translateY(0); pointer-events: auto; }
.bottom-drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
}
.bottom-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.bottom-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  gap: 12px;
}
.config-row label { color: var(--text); font-weight: 600; }

.btn-segment {
  display: flex;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 0px rgba(0,0,0,0.6);
}
.btn-segment button {
  flex: 1;
  padding: 8px 14px;
  background: var(--bg);
  border: none;
  border-left: var(--border);
  border-radius: 0;
  box-shadow: none;
  font-weight: 700;
  color: var(--muted);
  font-size: var(--text-meta);
  min-height: unset;
}
.btn-segment button:last-child { border-left: none; }
.btn-segment button.active { background: var(--accent); color: #fff; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: var(--border);
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 0px rgba(0,0,0,0.6);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  border-radius: 50%;
  transition: right 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { right: calc(100% - 21px); background: #fff; }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* Winner label */
.winner-label { font-size: var(--text-display); font-weight: 900; letter-spacing: -1px; }
.winner-label.red  { color: var(--red); }
.winner-label.blue { color: var(--blue); }

/* Viewer scores */
.viewer-scores { font-size: var(--text-sub); font-weight: 900; }

/* Error */
.error-msg { color: var(--red); font-size: var(--text-meta); min-height: 1.2em; font-weight: 700; }
.words-game-status { text-align: center; margin-bottom: 12px; }

/* Toast */
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  min-width: 220px;
  max-width: 90vw;
  font-size: var(--text-body);
  box-shadow: 0 3px 0px rgba(0,0,0,0.65);
  overflow: hidden;
  font-weight: 700;
  border: var(--border);
}
.toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
}
#toast-undo {
  background: var(--surface);
  border: var(--border);
  color: var(--text);
  padding: 4px 10px;
  font-size: var(--text-caption);
  border-radius: 6px;
  box-shadow: none;
}

/* Game ID badge */
.game-id-row { display: flex; align-items: center; gap: 4px; }
.btn-copy-id { background: transparent; border: none; box-shadow: none; padding: 4px; min-height: unset; color: var(--muted); line-height: 1; }
.btn-copy-id .material-symbols-rounded { font-size: 16px; }
.game-id-badge {
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.08em;
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 8px;
  padding: 4px 12px;
}

.last-word-choices { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.last-word-team-row { display: flex; gap: 10px; width: 100%; }
.last-word-team-row .btn-last-team { flex: 1; }
#btn-last-red  { background: var(--red);  color: #fff; }
#btn-last-blue { background: var(--blue); color: #fff; }

.btn-last-team { padding: 10px 16px; font-size: var(--text-body); border-radius: var(--radius); width: 100%; font-weight: 700; }

/* Viewer */
.viewer-info { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.viewer-presenter-label { font-size: var(--text-meta); font-weight: 700; color: var(--text); }
.viewer-team-red  { color: var(--red); }
.viewer-team-blue { color: var(--blue); }

/* ── Words page ── */
.screen-words-page {
  display: none;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px 80px;
  justify-content: flex-start;
  position: relative;
  background: var(--bg);
}
.screen-words-page.active { display: flex; }

.words-back-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: var(--text-meta);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: opacity 0.08s;
}
.words-back-btn:active { opacity: 0.5; }

.screen-words-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(255,61,90,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(250,204,21,0.09) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.words-container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.words-page-header {
  text-align: center;
  margin-bottom: 28px;
  animation: wFadeDown 0.5s ease both;
}
.words-page-header h1 {
  font-size: var(--text-title);
  font-weight: 900;
  color: var(--text);
}
.words-page-header .subtitle {
  margin-top: 10px;
  font-size: var(--text-body);
  color: var(--muted);
}

.words-input-row { display: flex; gap: 10px; margin-bottom: 24px; }
.words-input-row input[type="text"] {
  flex: 1;
  max-width: none;
}
.words-input-row .btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 16px;
}

.words-section { animation: wFadeUp 0.5s ease 0.2s both; }
.words-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.words-section-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.words-list-container { display: flex; flex-direction: column; gap: 8px; }

.words-list-container .word-item {
  background: var(--bg);
  border: var(--border);
  border-radius: 8px;
  padding: 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-meta);
  font-weight: 700;
  animation: wSlideIn 0.3s ease both;
  box-shadow: 0 2px 0px rgba(0,0,0,0.65);
  color: var(--text);
}
.words-list-container .word-item:hover { box-shadow: 0 2px 0px rgba(0,0,0,0.75); }
.words-list-container .word-text { flex: 1; }
.words-list-container .delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-meta);
  padding: 4px 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
  box-shadow: none;
}
.words-list-container .delete-btn:hover { color: var(--red); background: rgba(239,51,64,0.08); }
.words-list-container .delete-btn:active { transform: none; box-shadow: none; }

.words-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.6;
}
.words-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* Words toast */
#words-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
  width: min(calc(100% - 32px), 400px);
}
.w-toast {
  background: var(--bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: var(--text-meta);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  pointer-events: all;
  box-shadow: 0 3px 0px rgba(0,0,0,0.65);
  animation: wToastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  position: relative;
  overflow: hidden;
}
.w-toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 0 12px;
  animation: wToastBar var(--dur, 3500ms) linear forwards;
}
.w-toast.success::after   { background: var(--green); }
.w-toast.duplicate::after { background: var(--yellow); }
.w-toast.delete::after    { background: var(--red); }
.w-toast.error::after     { background: var(--accent); }
.w-toast-icon { font-size: 1.3rem; flex-shrink: 0; }
.w-toast-delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--red);
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}
.w-toast-msg  { flex: 1; line-height: 1.4; }
.w-toast-undo {
  background: var(--surface);
  border: var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-caption);
  font-weight: 500;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: none;
}
.w-toast-undo:hover { background: var(--card); }
.w-toast.hiding { animation: wToastOut 0.3s ease forwards; }

@keyframes wFadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wSlideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wToastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes wToastOut {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}
@keyframes wToastBar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* Confirm modal */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}
.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  width: min(88vw, 340px);
  z-index: 301;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: confirmIn 0.18s ease;
  box-shadow: var(--shadow-lg);
}
.confirm-message {
  font-size: var(--text-body);
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
  color: var(--text);
}
.confirm-buttons { display: flex; gap: 10px; }
.confirm-buttons button { flex: 1; }
@keyframes confirmIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
