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

:root {
  --bg: #1c1b1a;
  --bg-raised: #282625;
  --bg-selected: #363331;
  --border: #433f3c;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #bab4ac;
  --text-dim: #8f8982;
  --text-bright: #e0dcd6;
  --green: #7dab86;
  --green-hover: #e0e0e0;
  --green-active: #b8b8b8;
  --cyan: #5f9ea0;
  --yellow: #c4a24e;
  --red: #c45c5c;
  --orange: #c4884e;
  --pink: #c47da0;
  --btn-bg: #d0d0d0;
  --btn-hover: #e0e0e0;
  --btn-active: #b8b8b8;
  --font-mono: 'Monaco', 'Consolas', 'Courier New', monospace;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-tinted: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.5);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
}

.header h1 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.header .updated {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

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

.raid-count {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

/* ===== Search bar ===== */
.search-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  transition: var(--transition-smooth);
}

.search-bar:focus-within {
  background: var(--bg-selected);
  border-bottom-color: var(--text-dim);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 14px;
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.search-bar .clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition-smooth);
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar .clear-btn:hover {
  color: var(--red);
  background: rgba(196, 92, 92, 0.1);
}

.search-bar .clear-btn:active {
  transform: scale(0.95);
}

.search-bar .match-info {
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.search-bar .match-info.has-matches { 
  color: var(--cyan);
}

.search-bar .match-info.no-matches { 
  color: var(--red);
}

/* ===== Filter chips ===== */
.filter-chips {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.filter-chip:hover {
  border-color: var(--text-dim);
  background: var(--bg-selected);
}

.filter-chip:active {
  transform: scale(0.97);
}

.filter-chip.active {
  background: var(--bg-selected);
  border-color: var(--text-dim);
  color: var(--text-bright);
  font-weight: 600;
}

.source-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  min-width: 38px;
  text-align: center;
}

.source-chip.gishan.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
}

.source-chip.gofriend.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #3b82f6;
}

.chip-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

/* ===== GNSES bar ===== */
.gnses-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gnses-bar label {
  color: var(--cyan);
  font-weight: bold;
  font-size: 12px;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 4px;
}

.gnses-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  -webkit-text-security: disc;
}

.gnses-bar input::placeholder {
  color: var(--text-dim);
  -webkit-text-security: none;
}

.gnses-bar .gnses-status {
  font-size: 11px;
  white-space: nowrap;
}

.gnses-bar .gnses-actions {
  display: flex;
  gap: 4px;
}

.gnses-bar .gnses-actions button {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 32px;
}

.gnses-bar .gnses-actions button:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--bg-selected);
}

.gnses-bar .gnses-actions button:active {
  transform: scale(0.95);
}

/* ===== Raid list ===== */
.raid-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
  padding-bottom: 68px; /* Space for fixed action bar */
  position: relative;
}

.raid-list::-webkit-scrollbar { width: 8px; }
.raid-list::-webkit-scrollbar-track { background: var(--bg); }
.raid-list::-webkit-scrollbar-thumb { 
  background: var(--border); 
  border-radius: 4px;
  transition: background 0.2s;
}

.raid-list::-webkit-scrollbar-thumb:hover { 
  background: var(--text-dim); 
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  color: var(--text-dim);
  font-size: 14px;
  padding: 32px;
  text-align: center;
}

/* ===== Raid card grid ===== */
.raid-card-grid {
  display: grid;
  gap: 16px;
  padding: 20px;
}

/* Small mobile: 1 column */
@media (max-width: 480px) {
  .raid-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
}

/* Medium mobile/tablet: 2 columns */
@media (min-width: 481px) and (max-width: 768px) {
  .raid-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
  }
}

/* Large desktop: 3+ columns */
@media (min-width: 769px) {
  .raid-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px;
  }
}

/* ===== Raid card divider ===== */
.raid-card-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  position: relative;
}

.raid-card-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
  opacity: 0.6;
}

.divider-label {
  position: relative;
  background: var(--bg);
  padding: 4px 20px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-selected);
}

/* ===== Raid card ===== */
.raid-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}



.raid-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
  will-change: transform, box-shadow;
}

.raid-card.closed {
  opacity: 0.45;
}

.raid-card.closed:hover {
  transform: none;
  will-change: auto;
}

.raid-card.joined {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), var(--shadow-card);
}

.card-join-btn.joined {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Card header: boss name and posted time */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-boss-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.source-badge.gishan {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.source-badge.gofriend {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-boss {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-bright);
  word-break: break-word;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-boss .hl { 
  color: var(--green);
}

.card-wb {
  color: var(--pink);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
}

.card-posted {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card timer center */
.card-timer-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

.card-timer {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.card-timer.healthy { 
  color: var(--green);
}

.card-timer.warning { 
  color: var(--yellow);
}

.card-timer.ended { 
  color: var(--red);
}

/* Card host and location */
.card-host-location {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 20px;
}

/* Card join button */
.card-join-btn {
  width: 100%;
  padding: 12px;
  background: var(--btn-bg);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.card-join-btn:hover {
  background: var(--btn-hover);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.card-join-btn:active {
  background: var(--btn-active);
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.card-join-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--text-dim);
  box-shadow: none;
}

.card-join-btn.disabled:hover {
  background: var(--text-dim);
  transform: none;
  box-shadow: none;
}

.card-join-btn.disabled:active {
  transform: none;
}

/* ===== Action Bar ===== */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  min-height: 48px;
  height: 64px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-bar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.action-bar-btn:hover {
  background: var(--bg-selected);
  border-color: var(--text-dim);
  color: var(--text-bright);
}

.action-bar-btn:active {
  transform: scale(0.97);
}

/* ===== Action Bar Row ===== */
.action-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  padding: 8px 16px;
  gap: 12px;
  min-height: 48px;
}

.action-bar-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.status-indicator .status-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.status-indicator .status-text {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.action-bar-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.action-bar-message.error-msg {
  color: var(--red);
  background: rgba(196, 92, 92, 0.1);
  border: 1px solid rgba(196, 92, 92, 0.3);
}

.action-bar-message.success-msg {
  color: var(--green);
  background: rgba(125, 171, 134, 0.1);
  border: 1px solid rgba(125, 171, 134, 0.3);
}

/* Mobile action bar - hide status text */
@media (max-width: 768px) {
  .status-indicator .status-text {
    display: none;
  }
  
  .action-bar-row {
    padding: 6px 12px;
  }
  
  .action-bar-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ===== Bottom Sheet ===== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet {
  background: var(--bg-raised);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 769px) {
  .bottom-sheet {
    max-width: 600px;
    max-height: 60vh;
    border-radius: 20px;
    margin-bottom: 32px;
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-sheet-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0;
}

.recents-clear-btn {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(196, 92, 92, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.recents-clear-btn:hover {
  background: rgba(196, 92, 92, 0.1);
  border-color: rgba(196, 92, 92, 0.5);
}

.recents-clear-btn:active {
  transform: scale(0.95);
}

.recents-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-raised);
}

.recents-list::-webkit-scrollbar { width: 6px; }
.recents-list::-webkit-scrollbar-track { background: var(--bg-raised); }
.recents-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.recents-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ===== Recents Entry ===== */
.recents-entry {
  border-bottom: 1px solid var(--border-subtle);
}

.recents-entry:last-child {
  border-bottom: none;
}

.recents-entry-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.recents-entry-header:hover {
  background: var(--bg-selected);
}

.recents-entry-header:active {
  background: var(--bg);
}

.recents-entry-main {
  flex: 1;
  min-width: 0;
}

.recents-entry-boss {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recents-entry-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
}

.recents-entry-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recents-entry-sep {
  flex-shrink: 0;
}

.recents-entry-time {
  flex-shrink: 0;
  white-space: nowrap;
}

.recents-entry-code-preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  letter-spacing: 1px;
}

.recents-entry-remove {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.recents-entry-remove:hover {
  color: var(--red);
  background: rgba(196, 92, 92, 0.1);
  border-color: rgba(196, 92, 92, 0.3);
}

.recents-entry-remove:active {
  transform: scale(0.9);
}

/* ===== Join Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}

.modal-box h2 {
  color: var(--text-bright);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.modal-box .modal-host {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
}

.modal-box .friend-code {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 3px;
  margin-bottom: 16px;
  user-select: all;
  padding: 16px 24px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.copy-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.copy-btn:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.copy-btn:active {
  background: var(--green-active);
  transform: scale(0.97);
}

.modal-box .qr-container {
  margin: 16px auto;
  padding: 16px;
  background: white;
  border-radius: 12px;
  display: inline-block;
}

.modal-box .qr-container canvas,
.modal-box .qr-container img {
  image-rendering: pixelated;
  display: block;
}

.modal-box .dismiss-hint {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 20px;
}

/* ===== Join Fail Modal ===== */
.join-fail-title {
  color: var(--red) !important;
}

.join-fail-error {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: rgba(196, 92, 92, 0.1);
  border: 1px solid rgba(196, 92, 92, 0.3);
  border-radius: 8px;
  line-height: 1.5;
}

.join-fail-link {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--cyan);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.join-fail-link:hover {
  background: #7ab8ba;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.join-fail-link:active {
  background: #4f8587;
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.join-fail-link:disabled {
  background: var(--surface2);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.qr-blurred {
  filter: blur(4px);
  opacity: 0.7;
}

/* ===== Help Modal ===== */
.help-modal {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-selected);
}

.help-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0;
}

.help-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  border-radius: 6px;
}

.help-close:hover {
  background: var(--bg-raised);
  color: var(--text-bright);
}

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  overscroll-behavior: contain;
}

.help-section {
  margin-bottom: 28px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section p {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
}

.help-section p:last-child {
  margin-bottom: 0;
}

.help-section ul,
.help-section ol {
  margin-left: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.help-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.help-section li:last-child {
  margin-bottom: 0;
}

.help-section code {
  background: var(--bg-selected);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.help-section a {
  color: var(--cyan);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.help-section a:hover {
  color: var(--text-bright);
  text-decoration: underline;
}

.help-section strong {
  color: var(--text-bright);
  font-weight: 600;
}

.help-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-selected);
  display: flex;
  justify-content: flex-end;
}

.help-close-btn {
  background: var(--btn-bg);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-ui);
}

.help-close-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.help-close-btn:active {
  background: var(--btn-active);
  transform: translateY(0);
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .header { padding: 12px; gap: 8px; }
  .header h1 { font-size: 15px; }

  .search-bar { padding: 8px 12px; }

  .filter-chips { padding: 12px; }

  .raid-card {
    padding: 16px;
  }

  .card-boss {
    font-size: 16px;
  }

  .card-timer {
    font-size: 28px;
  }

  .card-timer-center {
    padding: 12px 0;
  }

  .card-join-btn {
    padding: 14px;
    font-size: 13px;
  }

  .action-bar-row { padding: 6px 12px; }

  .modal-box {
    padding: 24px;
    border-radius: 12px;
  }

  .modal-box .friend-code {
    font-size: 20px;
    letter-spacing: 2px;
    padding: 12px 16px;
  }

  .modal-box h2 {
    font-size: 18px;
  }

  .help-modal {
    width: 95%;
    max-height: 90vh;
  }

  .help-header {
    padding: 16px 20px;
  }

  .help-header h2 {
    font-size: 18px;
  }

  .help-content {
    padding: 20px;
  }

  .help-section {
    margin-bottom: 24px;
  }

  .help-section h3 {
    font-size: 15px;
  }

  .help-footer {
    padding: 12px 20px;
  }
}
