* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: #1a1025;
  color: #fff;
}

#game-canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Vignette overlays for Stealth & Danger */
#vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

#vignette-overlay.stealth {
  box-shadow: inset 0 0 110px 35px rgba(34, 197, 94, 0.42);
}

#vignette-overlay.suspicious {
  box-shadow: inset 0 0 100px 30px rgba(245, 158, 11, 0.45);
}

#vignette-overlay.danger {
  animation: dangerPulse 0.55s infinite alternate;
}

@keyframes dangerPulse {
  from {
    box-shadow: inset 0 0 90px 25px rgba(239, 68, 68, 0.45);
  }
  to {
    box-shadow: inset 0 0 150px 55px rgba(220, 38, 38, 0.78);
  }
}

/* Top HUD Bar */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.hud-card {
  background: rgba(20, 14, 28, 0.82);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(245, 180, 50, 0.5);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.stats-panel {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: #f3c66f;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(245, 180, 50, 0.5);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-sub {
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 600;
}

.quota-bar-wrap {
  width: 170px;
  height: 12px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-top: 4px;
}

.quota-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #fde047, #ffffff);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.bars-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 175px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
}

.bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill.stamina {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #86efac);
  transition: width 0.1s linear;
}

.bar-fill.hp {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #f87171);
  transition: width 0.15s ease;
}

.bar-fill.stamina.boosted {
  background: linear-gradient(90deg, #facc15, #fef08a);
  box-shadow: 0 0 10px 3px rgba(250, 204, 21, 0.9);
  animation: staminaGlow 0.6s ease-in-out infinite alternate;
}

@keyframes staminaGlow {
  from { box-shadow: 0 0 6px 1px rgba(250, 204, 21, 0.7); }
  to { box-shadow: 0 0 14px 5px rgba(254, 240, 138, 1); }
}

.bar-fill.stealth {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b, #ef4444);
  transition: width 0.15s ease;
}

/* Live Character Portraits Panel */
.portraits-panel {
  display: flex;
  gap: 14px;
  align-items: center;
}

.portrait-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 11, 22, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 215px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.portrait-box.cow-box {
  border-color: #f59e0b;
}

.portrait-box.wojak-box {
  border-color: #94a3b8;
}

.portrait-box.wojak-box.alert-suspicious {
  border-color: #f59e0b;
  background: rgba(65, 38, 10, 0.88);
}

.portrait-box.wojak-box.alert-chase {
  border-color: #ef4444;
  background: rgba(85, 15, 20, 0.9);
  animation: portraitShake 0.3s infinite alternate;
}

@keyframes portraitShake {
  from { transform: translateX(-2px) rotate(-1deg); }
  to { transform: translateX(2px) rotate(1deg); }
}

.portrait-img-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  background: #fff;
}

.portrait-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 5px;
  border-top-left-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fde047;
}

.portrait-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portrait-name {
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
}

.portrait-box.wojak-box .portrait-name {
  color: #e2e8f0;
}

.portrait- dialogue, .portrait-dialogue {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  max-width: 145px;
  line-height: 1.25;
  word-break: keep-all;
}

/* Right Top Radar & Action Buttons */
.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.radar-card {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#radar-canvas {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 2px solid rgba(245, 180, 50, 0.65);
  background: radial-gradient(circle, rgba(25, 42, 28, 0.92) 0%, rgba(12, 20, 15, 0.98) 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}

.radar-legend {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
}

.quick-buttons {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-btn {
  background: rgba(25, 18, 36, 0.88);
  color: #f8fafc;
  border: 1.5px solid rgba(245, 180, 50, 0.55);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-btn:hover {
  background: rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}

/* Bottom Controls & Status Banner */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.controls-guide {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #e2e8f0;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom-width: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
}

#status-banner {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

#status-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#status-banner.banner-eat {
  background: rgba(245, 158, 11, 0.92);
  border: 2px solid #fef08a;
  color: #fff;
}

#status-banner.banner-stealth {
  background: rgba(22, 163, 74, 0.9);
  border: 2px solid #bbf7d0;
  color: #fff;
}

#status-banner.banner-danger {
  background: rgba(220, 38, 38, 0.95);
  border: 2px solid #fecaca;
  color: #fff;
}

/* Floating Eat Popups */
#floating-popups {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  overflow: hidden;
}

.eat-popup {
  position: absolute;
  font-size: 18px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 12px rgba(245, 158, 11, 0.8);
  transform: translate(-50%, -50%);
  animation: floatUpFade 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

.eat-popup.golden {
  font-size: 22px;
  color: #fde047;
  text-shadow: 0 2px 10px rgba(234, 179, 8, 1), 0 0 20px #ffffff;
}

@keyframes floatUpFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.7);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -95%) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -165%) scale(0.95);
  }
}

/* Modals (Start, Stage Clear, Game Over) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(32, 19, 48, 0.82) 0%, rgba(10, 6, 16, 0.94) 100%);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  max-width: 680px;
  width: 100%;
  background: linear-gradient(180deg, rgba(35, 24, 52, 0.97) 0%, rgba(20, 14, 30, 0.98) 100%);
  border: 3px solid #f59e0b;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 40px rgba(245, 158, 11, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.modal-title {
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(90deg, #fde047, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 16px;
  color: #e2e8f0;
  line-height: 1.55;
  max-width: 540px;
  word-break: keep-all;
}

.versus-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
  margin: 4px 0;
  flex-wrap: wrap;
}

.character-card {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 14px 18px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.character-card.cow {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}

.character-card.wojak {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.18);
}

.character-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: #fff;
}

.char-title {
  font-size: 16px;
  font-weight: 800;
  color: #fde047;
}

.character-card.wojak .char-title {
  color: #fca5a5;
}

.char-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: keep-all;
}

.vs-badge {
  font-size: 28px;
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
}

.tips-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 20px;
  text-align: left;
  width: 100%;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.65;
}

.tips-box strong {
  color: #fde047;
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  padding: 14px 40px;
  border: 2px solid #fef08a;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.7);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Mobile Touch Controls: joystick (left) + action buttons (right) */
#touch-controls {
  display: none;
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: calc(24px + env(safe-area-inset-left));
  right: calc(24px + env(safe-area-inset-right));
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 20;
}

@media (max-width: 900px), (pointer: coarse) {
  #touch-controls {
    display: flex;
  }
  .controls-guide {
    display: none;
  }
  .portraits-panel {
    display: none;
  }
  #lock-hint {
    display: none;
  }
}

/* Look-around drag (touch) and the joystick must not scroll or zoom the page */
#game-canvas-container canvas,
#stick {
  touch-action: none;
}

#stick {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.4);
  pointer-events: auto;
}

#stick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.8);
  border: 2px solid #fef08a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.touch-actions {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.action-circle-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid #fef08a;
  background: rgba(245, 158, 11, 0.75);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  touch-action: none;
}

#lock-hint {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.85);
  border: 1.5px solid rgba(245, 180, 50, 0.6);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  z-index: 14;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#lock-hint.show {
  opacity: 1;
}

/* Responsive HUD: phones in portrait */
@media (max-width: 700px) {
  #hud {
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 8px calc(8px + env(safe-area-inset-left));
  }
  .hud-top {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .hud-card {
    padding: 8px 10px;
    border-radius: 12px;
    border-width: 1.5px;
  }
  .stats-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    flex: 1;
    min-width: 0;
  }
  .stat-value {
    font-size: 20px;
  }
  .quota-bar-wrap {
    width: 100%;
  }
  .bars-column {
    grid-column: 1 / -1;
    min-width: 0;
    gap: 5px;
  }
  .bar-header {
    font-size: 11px;
  }
  .bar-track {
    height: 8px;
  }
  .radar-card {
    padding: 5px;
  }
  #radar-canvas {
    width: 92px;
    height: 92px;
  }
  .radar-legend {
    display: none;
  }
  .hud-right {
    gap: 6px;
  }
  .quick-buttons {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }
  .hud-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
  #status-banner {
    top: calc(232px + env(safe-area-inset-top));
    width: max-content;
    max-width: 92vw;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 14px;
    text-align: center;
    line-height: 1.35;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal-card {
    max-height: 100%;
    overflow-y: auto;
    padding: 18px 16px;
    gap: 12px;
    border-radius: 18px;
  }
  .modal-title {
    font-size: 24px;
  }
  .modal-subtitle {
    font-size: 14px;
  }
  /* 흐놀 / VS / 우작 stacked top to bottom */
  .versus-showcase {
    flex-direction: column;
    gap: 4px;
  }
  .character-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 2px 12px;
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    text-align: left;
  }
  .character-card img {
    grid-row: 1 / 3;
    width: 72px;
    height: 72px;
  }
  .char-desc {
    font-size: 11.5px;
  }
  .vs-badge {
    font-size: 20px;
  }
  .tips-box {
    font-size: 12.5px;
    padding: 10px 12px;
    line-height: 1.5;
  }
  /* the card scrolls on small screens: keep the action button pinned in view */
  .primary-btn {
    position: sticky;
    bottom: 2px;
    flex-shrink: 0;
    font-size: 17px;
    padding: 12px 24px;
  }
  .eat-popup {
    font-size: 15px;
  }
}

/* Responsive HUD: short screens (phones in landscape) keep the middle of the view free */
@media (max-height: 520px) {
  #hud {
    padding: calc(6px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 6px calc(10px + env(safe-area-inset-left));
  }
  .hud-top {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .hud-card {
    padding: 6px 10px;
    border-radius: 12px;
    border-width: 1.5px;
  }
  .stats-panel {
    gap: 12px;
  }
  .stat-value {
    font-size: 18px;
  }
  .quota-bar-wrap {
    width: 110px;
    height: 8px;
    margin-top: 2px;
  }
  .bars-column {
    min-width: 120px;
    gap: 4px;
  }
  .bar-header {
    display: none;
  }
  .bar-track {
    height: 7px;
  }
  .radar-card {
    padding: 4px;
  }
  #radar-canvas {
    width: 76px;
    height: 76px;
  }
  .radar-legend {
    display: none;
  }
  .quick-buttons {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .hud-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  #status-banner {
    top: calc(12px + env(safe-area-inset-top));
    max-width: 50vw;
    padding: 6px 14px;
    font-size: 13px;
  }
  #touch-controls {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  #stick {
    width: 110px;
    height: 110px;
  }
  #stick-knob {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
  }
  .action-circle-btn {
    width: 58px;
    height: 58px;
    font-size: 12px;
  }
  .modal-backdrop {
    padding: 8px;
  }
  .modal-card {
    max-height: 100%;
    overflow-y: auto;
    padding: 14px 18px;
    gap: 10px;
  }
  .modal-title {
    font-size: 22px;
  }
  .versus-showcase {
    gap: 8px;
  }
  .character-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 2px 10px;
    width: 270px;
    padding: 8px 10px;
    text-align: left;
  }
  .character-card img {
    grid-row: 1 / 3;
    width: 56px;
    height: 56px;
  }
  .tips-box {
    font-size: 12px;
    padding: 8px 12px;
    line-height: 1.45;
  }
  .primary-btn {
    position: sticky;
    bottom: 2px;
    flex-shrink: 0;
    font-size: 16px;
    padding: 10px 28px;
  }
}

/* Settings (ESC / gear) */
[hidden] {
  display: none !important;
}

.hud-btn-icon {
  font-size: 15px;
  line-height: 1;
  padding: 5px 9px;
}

#settings-modal {
  z-index: 60;
}

.settings-card {
  max-height: 100%;
  overflow-y: auto;
  gap: 14px;
}

.settings-section {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-section h2 {
  font-size: 15px;
  color: #fde047;
}

.set-hint {
  font-size: 12px;
  color: #cbd5e1;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
}

.set-row input[type='range'] {
  flex: 1;
  max-width: 220px;
  accent-color: #f59e0b;
}

.set-row output {
  width: 40px;
  text-align: right;
  color: #fde047;
}

.key-bind {
  min-width: 96px;
  font-size: 13px;
}

.key-bind.waiting {
  border-color: #fde047;
  color: #fde047;
  animation: dangerPulse 0.8s infinite alternate;
}

.settings-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Achievements */
.modal-links {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#achv-modal {
  z-index: 60;
}

#achv-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.14);
  opacity: 0.7;
}

.achv-row.done {
  opacity: 1;
  border-color: rgba(245, 158, 11, 0.8);
  background: rgba(245, 158, 11, 0.12);
}

.achv-row small,
.achv-toast small {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.35;
  word-break: keep-all;
}

.achv-row strong {
  font-size: 15px;
  color: #fde047;
}

.achv-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #fde68a, #d97706);
  border: 2px solid #fef08a;
}

.achv-row:not(.done) .achv-icon {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  filter: grayscale(1);
}

#achv-toasts {
  position: fixed;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}

.achv-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 28, 0.94);
  border: 2px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(245, 158, 11, 0.45);
  animation: achvToast 4.2s ease forwards;
}

.achv-toast strong {
  font-size: 15px;
  color: #fff;
}

.achv-toast small {
  color: #fde047;
  font-weight: 800;
}

@keyframes achvToast {
  0% { opacity: 0; transform: translateY(14px) scale(0.92); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  88% { opacity: 1; }
  100% { opacity: 0; }
}
