/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Google Sans', 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: #f1f3f4; color: #202124; line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 6px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s;
}
.btn.primary { background: #1a73e8; color: #fff; }
.btn.primary:hover { background: #1557b0; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.btn.outline { background: transparent; color: #1a73e8; border: 1px solid #dadce0; }
.btn.outline:hover { background: #e8f0fe; border-color: #1a73e8; }
.btn.full { width: 100%; justify-content: center; padding: 10px; }
.icon-btn {
  background: none; border: none; cursor: pointer; padding: 8px;
  border-radius: 50%; color: #5f6368; display: inline-flex;
  align-items: center; justify-content: center; transition: background 0.2s;
}
.icon-btn:hover { background: rgba(0,0,0,0.06); }
.icon-btn.small { padding: 4px; }

/* ---- FORM FIELDS ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: #5f6368; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dadce0;
  border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color 0.2s; outline: none; background: #fff;
}
.field input:focus, .field textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }

/* ---- LOGIN ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #e8f0fe; }
.login-container {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 28px; color: #202124; margin-top: 8px; }
.login-logo .subtitle { font-size: 14px; color: #5f6368; }
.login-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #e8eaed; }
.tab {
  flex: 1; padding: 10px; background: none; border: none; font-size: 14px;
  font-weight: 500; color: #5f6368; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.tab.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.error-msg { background: #fce8e6; color: #c5221f; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ---- TOPBAR ---- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px; background: #fff;
  border-bottom: 1px solid #e8eaed;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.logo-text { font-size: 20px; font-weight: 500; color: #202124; }

/* ---- AVATAR ---- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 500; font-size: 16px;
  flex-shrink: 0;
}
.avatar.small { width: 32px; height: 32px; font-size: 14px; }
.avatar.tiny { width: 24px; height: 24px; font-size: 11px; }

/* ---- HOME ---- */
.home-main { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.home-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.home-header h2 { font-size: 22px; font-weight: 400; }
.home-actions { display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 60px 20px; color: #5f6368; }
.empty-state.small { padding: 30px 20px; }
.empty-state svg { margin-bottom: 16px; }

/* ---- CLASS CARDS ---- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.class-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid #e8eaed; transition: box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.class-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.class-card-header { padding: 20px; color: #fff; min-height: 100px; display: flex; flex-direction: column; justify-content: flex-end; }
.class-card-header h3 { font-size: 20px; font-weight: 500; }
.class-card-header .section { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.class-card-body { padding: 16px 20px; flex: 1; }
.class-card-body .owner { font-size: 13px; color: #5f6368; }
.class-card-stats { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: #80868b; }
.class-card-code { padding: 10px 20px; font-size: 12px; color: #80868b; border-top: 1px solid #f1f3f4; }

/* ---- DIALOG ---- */
.dialog {
  border: none; border-radius: 16px; padding: 28px;
  max-width: 440px; width: 90vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.dialog::backdrop { background: rgba(0,0,0,0.4); }
.dialog h3 { font-size: 20px; margin-bottom: 4px; }
.dialog-desc { font-size: 13px; color: #5f6368; margin-bottom: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- CLASS VIEW ---- */
.class-banner {
  padding: 32px 24px; color: #fff; min-height: 140px;
  display: flex; align-items: flex-end;
}
.class-banner-content { max-width: 760px; margin: 0 auto; width: 100%; }
.class-banner h1 { font-size: 32px; font-weight: 400; }
.class-banner p { font-size: 14px; opacity: 0.85; }
.class-desc { margin-top: 4px; }
.class-code-badge {
  display: inline-block; margin-top: 10px; padding: 4px 12px;
  background: rgba(255,255,255,0.2); border-radius: 4px; font-size: 13px;
  backdrop-filter: blur(4px);
}

.class-layout {
  max-width: 960px; margin: 0 auto; padding: 20px 16px;
  display: flex; gap: 20px;
}

/* ---- STREAM ---- */
.stream { flex: 1; min-width: 0; }

/* ---- COMPOSER ---- */
.composer {
  background: #fff; border-radius: 12px; border: 1px solid #e8eaed;
  margin-bottom: 16px; overflow: hidden;
}
.composer-collapsed {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: background 0.2s;
}
.composer-collapsed:hover { background: #f8f9fa; }
.composer-placeholder { color: #80868b; font-size: 14px; }
.composer-expanded { padding: 16px; }
.composer-type-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.type-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  background: #f1f3f4; color: #5f6368; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s;
}
.type-chip input { display: none; }
.type-chip.selected { background: #e8f0fe; color: #1a73e8; border-color: #1a73e8; }
.type-chip:hover { background: #e8eaed; }
.type-chip.selected:hover { background: #d2e3fc; }
.composer-title {
  width: 100%; padding: 8px 0; border: none; border-bottom: 1px solid #e8eaed;
  font-size: 16px; font-family: inherit; outline: none; margin-bottom: 8px;
}
.composer-content {
  width: 100%; padding: 8px 0; border: none; font-size: 14px;
  font-family: inherit; outline: none; resize: vertical; min-height: 60px;
}
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---- POST CARD ---- */
.post-card {
  background: #fff; border-radius: 12px; border: 1px solid #e8eaed;
  margin-bottom: 12px; overflow: hidden;
}
.post-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 0;
}
.post-meta { flex: 1; }
.post-author { font-weight: 500; font-size: 14px; display: block; }
.post-time { font-size: 11px; color: #80868b; }
.post-type-badge {
  padding: 3px 10px; border-radius: 12px; font-size: 11px;
  font-weight: 500; text-transform: uppercase;
}
.post-type-badge.announcement { background: #e8f0fe; color: #1a73e8; }
.post-type-badge.question { background: #fef7e0; color: #e37400; }
.post-type-badge.material { background: #e6f4ea; color: #188038; }
.post-title { padding: 8px 16px 0; font-size: 16px; font-weight: 500; }
.post-content { padding: 8px 16px 14px; font-size: 14px; color: #3c4043; white-space: pre-wrap; }
.post-footer { padding: 0 16px 10px; }
.comment-toggle {
  background: none; border: none; font-size: 13px; color: #5f6368;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; transition: background 0.2s;
}
.comment-toggle:hover { background: #f1f3f4; }
.delete-form { margin-left: auto; }

/* ---- COMMENTS ---- */
.comments-section { border-top: 1px solid #f1f3f4; }
.comments-list { padding: 12px 16px; }
.comment-item {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-author { font-weight: 500; font-size: 13px; }
.comment-time { font-size: 11px; color: #80868b; margin-left: 8px; }
.comment-body p { font-size: 13px; color: #3c4043; margin-top: 2px; }
.comment-form {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-top: 1px solid #f1f3f4;
}
.comment-form input {
  flex: 1; padding: 8px 12px; border: 1px solid #e8eaed;
  border-radius: 20px; font-size: 13px; font-family: inherit; outline: none;
}
.comment-form input:focus { border-color: #1a73e8; }
.empty-hint { font-size: 13px; color: #80868b; padding: 8px 0; }

/* ---- PEOPLE SIDEBAR ---- */
.people-sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff; border-radius: 12px; border: 1px solid #e8eaed;
  padding: 16px; height: fit-content; position: sticky; top: 84px;
}
.people-sidebar h3 { font-size: 16px; margin-bottom: 12px; color: #202124; }
.people-section { margin-bottom: 16px; }
.people-section h4 { font-size: 12px; text-transform: uppercase; color: #80868b; letter-spacing: 0.5px; margin-bottom: 8px; }
.person-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }

/* ---- AVATAR EMOJI ---- */
.avatar { user-select: none; }
.avatar-link { text-decoration: none; }

/* ---- TITLE BADGES ---- */
.user-title-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500; background: #f3e8fd; color: #7c3aed;
  vertical-align: middle; margin-left: 4px;
}
.user-title-badge.small { font-size: 10px; padding: 1px 6px; }
.user-title-badge.tiny { font-size: 9px; padding: 1px 5px; display: block; margin-left: 0; margin-top: 1px; }
.person-info { display: flex; flex-direction: column; gap: 0; }

/* ---- PROFILE PAGE ---- */
.profile-main { max-width: 520px; margin: 0 auto; padding: 24px 16px; }
.profile-card { background: #fff; border-radius: 12px; border: 1px solid #e8eaed; overflow: hidden; }
.profile-preview {
  text-align: center; padding: 32px 20px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
}
.profile-preview h2 { margin-top: 12px; font-size: 20px; }
.profile-username { font-size: 13px; color: #80868b; margin-top: 2px; }
.avatar.large { width: 80px; height: 80px; font-size: 36px; margin: 0 auto; }
.profile-form { padding: 20px; }
.success-msg { background: #e6f4ea; color: #188038; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* Color picker grid */
.color-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch { cursor: pointer; }
.color-swatch input { display: none; }
.color-swatch span {
  display: block; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent; transition: all 0.15s;
}
.color-swatch.selected span, .color-swatch:hover span {
  border-color: #202124; transform: scale(1.15);
}

/* Emoji picker grid */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-option { cursor: pointer; }
.emoji-option input { display: none; }
.emoji-option span {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px; font-size: 22px;
  border: 2px solid transparent; transition: all 0.15s;
  background: #f8f9fa;
}
.emoji-option.selected span, .emoji-option:hover span {
  border-color: #1a73e8; background: #e8f0fe;
}

/* ---- ADMIN PAGE ---- */
.admin-main { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.admin-card { background: #fff; border-radius: 12px; border: 1px solid #e8eaed; padding: 24px; }
.admin-card h2 { font-size: 20px; margin-bottom: 4px; }
.admin-card h3 { font-size: 16px; margin-bottom: 12px; }
.admin-desc { font-size: 13px; color: #5f6368; margin-bottom: 20px; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f3f4;
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.admin-user-name { font-weight: 500; font-size: 14px; }
.admin-user-username { font-size: 12px; color: #80868b; margin-left: 4px; }
.admin-title-input { display: flex; gap: 6px; align-items: center; }
.title-input {
  width: 160px; padding: 6px 10px; border: 1px solid #dadce0;
  border-radius: 6px; font-size: 13px; font-family: inherit; outline: none;
}
.title-input:focus { border-color: #1a73e8; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.title-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.title-suggestion {
  padding: 4px 12px; border-radius: 16px; font-size: 12px;
  background: #f3e8fd; color: #7c3aed; cursor: pointer;
  transition: background 0.15s; user-select: none;
}
.title-suggestion:hover { background: #e9d5ff; }

/* ---- ROLE BADGES ---- */
.role-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  vertical-align: middle; margin-left: 4px;
}
.role-badge.admin { background: #fce8e6; color: #c5221f; }
.role-badge.mod { background: #e8f0fe; color: #1a73e8; }

/* ---- MOD PANEL ---- */
.mod-user-list { display: flex; flex-direction: column; gap: 0; }
.mod-user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f3f4;
  flex-wrap: wrap;
}
.mod-user-row:last-child { border-bottom: none; }
.mod-user-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.mod-user-info { flex: 1; }
.mod-user-name { font-size: 14px; }
.mod-username { font-size: 12px; color: #80868b; }
.mod-user-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.status-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.status-tag.muted { background: #fef7e0; color: #e37400; }
.status-tag.locked { background: #fce8e6; color: #c5221f; }
.status-tag.ip { background: #f1f3f4; color: #80868b; }
.mod-user-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.inline-form { display: inline; }
.btn.warning { background: #f9ab00; color: #fff; }
.btn.warning:hover { background: #e69500; }
.btn.danger { background: #d93025; color: #fff; }
.btn.danger:hover { background: #b3261e; }
.admin-protected { font-size: 11px; color: #80868b; font-style: italic; }

.ban-list { display: flex; flex-direction: column; gap: 4px; }
.ban-row { display: flex; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f8f9fa; }
.ban-ip { font-family: monospace; color: #202124; }
.ban-reason { color: #5f6368; flex: 1; }
.ban-until { color: #80868b; font-size: 12px; }

.rules-list { list-style: none; padding: 0; }
.rules-list li { padding: 6px 0; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.rule-tag { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.rule-tag.danger { background: #fce8e6; color: #c5221f; }

.muted-composer { opacity: 0.6; cursor: not-allowed; }

/* ---- SHIP SYSTEM ---- */
.ship-badge { font-size: 14px; vertical-align: middle; cursor: default; }
.ship-badge.small { font-size: 12px; }
.ship-inline { font-size: 12px; font-weight: 500; margin-left: 6px; }
.ship-nav-btn { font-size: 13px !important; }
.ship-controls { display: flex; gap: 3px; align-items: center; }
.btn.ship-up { background: linear-gradient(135deg, #34a853, #1a73e8); color: #fff; }
.btn.ship-up:hover { box-shadow: 0 2px 8px rgba(26,115,232,0.3); }

/* Ships page */
.ships-main { max-width: 600px; margin: 0 auto; padding: 24px 16px; }
.ship-showcase {
  background: #fff; border-radius: 16px; border: 2px solid #e8eaed;
  padding: 40px 24px; text-align: center; margin-bottom: 32px;
  transition: border-color 0.3s;
}
.ship-showcase-icon {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #e8eaed; transition: all 0.3s;
}
.ship-big-icon { font-size: 56px; }
.ship-showcase h1 { font-size: 28px; font-weight: 400; margin-bottom: 6px; }
.ship-desc { font-size: 14px; color: #5f6368; margin-bottom: 20px; }
.ship-level-bar {
  width: 100%; max-width: 300px; height: 8px; background: #f1f3f4;
  border-radius: 4px; margin: 0 auto 8px; overflow: hidden;
}
.ship-level-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.ship-level-label { font-size: 12px; color: #80868b; }

.tiers-heading { font-size: 18px; font-weight: 400; margin-bottom: 4px; }
.tiers-desc { font-size: 13px; color: #5f6368; margin-bottom: 16px; }

.ship-tier-list { display: flex; flex-direction: column; gap: 8px; }
.ship-tier-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: #fff; border-radius: 12px; border: 1px solid #e8eaed;
  transition: all 0.2s;
}
.ship-tier-card.current { border-color: #1a73e8; box-shadow: 0 2px 8px rgba(26,115,232,0.12); }
.ship-tier-card.locked { opacity: 0.5; }
.tier-level { font-size: 10px; font-weight: 700; color: #80868b; letter-spacing: 1px; min-width: 36px; }
.tier-icon {
  width: 48px; height: 48px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
  border: 2px solid #e8eaed; flex-shrink: 0;
}
.tier-info { flex: 1; min-width: 0; }
.tier-info h3 { font-size: 15px; font-weight: 500; }
.tier-info p { font-size: 12px; color: #5f6368; }
.tier-badge {
  padding: 3px 10px; border-radius: 10px; font-size: 9px;
  font-weight: 700; letter-spacing: 0.5px; white-space: nowrap;
}
.current-badge { color: #fff; }
.unlocked-badge { background: #e6f4ea; color: #188038; }
.locked-badge { background: #f1f3f4; color: #80868b; }
.exclusive-badge { background: linear-gradient(135deg, #ff1744, #d500f9); color: #fff; }
.ship-tier-card.exclusive { border: 2px solid #ff1744; background: linear-gradient(135deg, #fff5f5, #fff); }
.ship-tier-card.exclusive.current { box-shadow: 0 4px 20px rgba(255,23,68,0.25); }

/* ---- BATTLE ARENA ---- */
.arena-page { background: #0d1117; color: #e6edf3; }
.arena-main { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.arena-header { text-align: center; margin-bottom: 24px; }
.arena-header h1 { font-size: 24px; font-weight: 400; color: #7fdbff; }
.arena-header p { font-size: 13px; color: #8b949e; }
.arena-record { font-size: 13px; font-weight: 600; }
.arena-wins { color: #3fb950; }
.arena-losses { color: #f85149; }
.arena-nav-btn { font-size: 13px !important; border-color: #ff6d01 !important; color: #ff6d01 !important; }
.arena-nav-btn:hover { background: #ff6d0118 !important; }

/* Fighter cards */
.fighter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fighter-card {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; transition: all 0.2s;
}
.fighter-card:hover { border-color: #7fdbff44; box-shadow: 0 4px 20px rgba(127,219,255,0.08); }
.fighter-ship-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 28px;
  border: 2px solid #30363d;
}
.fighter-info { text-align: center; }
.fighter-info h3 { font-size: 15px; color: #e6edf3; }
.fighter-ship-name { font-size: 12px; font-weight: 500; }
.fighter-stats-row { display: flex; gap: 10px; font-size: 11px; color: #8b949e; margin-top: 4px; }
.fighter-record { font-size: 11px; color: #8b949e; margin-top: 2px; }
.arena-fight-btn {
  background: linear-gradient(135deg, #f85149, #ff6d01) !important;
  color: #fff !important; font-weight: 700; letter-spacing: 1px; width: 100%;
  margin-top: 4px; border: none;
}
.arena-fight-btn:hover { box-shadow: 0 4px 16px rgba(248,81,73,0.3); }

/* Battle history */
.arena-section-title { font-size: 16px; font-weight: 400; color: #8b949e; margin: 24px 0 12px; }
.battle-history { display: flex; flex-direction: column; gap: 6px; }
.battle-history-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  padding: 10px 14px; text-decoration: none; color: #e6edf3;
  font-size: 13px; transition: border-color 0.2s;
}
.battle-history-row:hover { border-color: #7fdbff44; }
.bh-player { display: flex; align-items: center; gap: 6px; flex: 1; }
.bh-player.right { justify-content: flex-end; text-align: right; }
.bh-icon { font-size: 18px; }
.bh-ship { font-size: 14px; }
.bh-vs { padding: 0 12px; }
.bh-result { padding: 2px 10px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.bh-result.win { background: #238636; color: #fff; }
.bh-result.loss { background: #da3633; color: #fff; }

/* Battle page */
.battle-main { max-width: 700px; margin: 0 auto; padding: 20px 16px; }
.battle-ships { display: flex; align-items: flex-start; justify-content: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.battle-ship {
  flex: 1; min-width: 180px; max-width: 250px;
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 20px 16px; text-align: center;
  transition: transform 0.1s;
}
.battle-ship.shake { animation: shipShake 0.4s; }
@keyframes shipShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.battle-ship-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  border: 2px solid #30363d;
}
.battle-ship h3 { font-size: 16px; margin-bottom: 2px; }
.battle-ship-name { font-size: 12px; font-weight: 500; }
.battle-hp-bar {
  width: 100%; height: 10px; background: #21262d; border-radius: 5px;
  margin: 10px 0 4px; overflow: hidden;
}
.battle-hp-fill { height: 100%; border-radius: 5px; transition: width 0.4s, background 0.4s; }
.battle-hp-text { font-size: 12px; color: #8b949e; font-family: monospace; }
.battle-stat-pills { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.battle-stat-pills span {
  padding: 2px 8px; background: #21262d; border-radius: 4px;
  font-size: 10px; color: #8b949e;
}
.battle-special { font-size: 11px; color: #7fdbff; margin-top: 6px; }
.battle-special small { color: #8b949e; }
.battle-vs {
  font-size: 28px; font-weight: 900; color: #f85149;
  align-self: center; padding: 20px 0;
  text-shadow: 0 0 20px rgba(248,81,73,0.4);
}

/* Battle log */
.battle-log {
  background: #0d1117; border: 1px solid #30363d; border-radius: 12px;
  padding: 16px; max-height: 400px; overflow-y: auto;
  font-family: 'Courier New', monospace; font-size: 13px;
}
.battle-log-entry { padding: 4px 0; border-bottom: 1px solid #21262d; }
.battle-log-entry:last-child { border-bottom: none; }
.battle-log-entry.system { color: #8b949e; text-align: center; }
.battle-log-entry.round-header { color: #7fdbff; margin-top: 8px; }
.battle-log-entry.winner { color: #3fb950; font-size: 16px; margin-top: 8px; }
.dmg-text { color: #f85149; font-weight: 700; }
.crit-text { color: #ff6d01; font-weight: 700; font-size: 14px; }
.special-text { color: #d2a8ff; font-weight: 600; }
.dodge-text { color: #3fb950; font-style: italic; }

/* Winner banner */
.winner-banner {
  text-align: center; margin-top: 20px; padding: 30px;
  background: #161b22; border: 2px solid #3fb950; border-radius: 16px;
  animation: winPulse 1.5s infinite;
}
@keyframes winPulse {
  0%,100% { box-shadow: 0 0 20px rgba(63,185,80,0.15); }
  50% { box-shadow: 0 0 40px rgba(63,185,80,0.3); }
}
.winner-icon { font-size: 64px; margin-bottom: 8px; }
.winner-banner h2 { color: #3fb950; font-size: 28px; letter-spacing: 2px; }

/* ---- SHOP ---- */
.shop-nav-btn { border-color: #fbbc04 !important; color: #fbbc04 !important; font-size: 13px !important; }
.shop-nav-btn:hover { background: #fbbc0418 !important; }
.shop-main { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.shop-header { text-align: center; margin-bottom: 24px; }
.shop-header h1 { font-size: 24px; color: #7fdbff; font-weight: 400; }
.shop-header p { font-size: 13px; color: #8b949e; }
.shop-section-title { font-size: 16px; color: #8b949e; margin: 20px 0 10px; font-weight: 400; }

.credits-display { display: flex; align-items: center; gap: 4px; font-weight: 700; color: #fbbc04; font-size: 15px; }
.credits-icon { font-size: 16px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shop-card {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 16px; text-align: center; transition: all 0.2s;
}
.shop-card.owned { border-color: #238636; }
.shop-card:hover { border-color: #7fdbff44; }
.shop-item-icon { font-size: 36px; margin-bottom: 6px; }
.shop-card h3 { font-size: 14px; color: #e6edf3; margin-bottom: 4px; }
.shop-item-desc { font-size: 11px; color: #8b949e; margin-bottom: 8px; min-height: 30px; }
.shop-item-cost { font-size: 14px; color: #fbbc04; font-weight: 600; margin-bottom: 8px; }
.shop-buy-btn { background: linear-gradient(135deg, #fbbc04, #ff6d01) !important; color: #000 !important; font-weight: 700; width: 100%; border: none; }
.shop-equip-btn { background: #238636 !important; color: #fff !important; font-weight: 600; width: 100%; border: none; }
.shop-equipped { background: #0d2818 !important; color: #3fb950 !important; border: 1px solid #238636 !important; width: 100%; font-weight: 600; }
.shop-locked { background: #21262d !important; color: #484f58 !important; width: 100%; border: none; font-size: 11px; }
.shop-owned-label { display: block; color: #3fb950; font-size: 12px; font-weight: 600; margin-top: 8px; }
.shop-earn-info {
  margin-top: 32px; padding: 20px; background: #161b22; border: 1px solid #30363d;
  border-radius: 12px; text-align: center;
}
.shop-earn-info h3 { color: #7fdbff; font-size: 16px; margin-bottom: 6px; }
.shop-earn-info p { font-size: 13px; color: #8b949e; }

/* ---- REPORTS ---- */
.report-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #188038; color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; z-index: 999; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.report-btn { color: #8b949e !important; }
.report-btn:hover { color: #f85149 !important; }
.report-card {
  padding: 14px 0; border-bottom: 1px solid #f1f3f4;
}
.report-card.pending { background: #fffde7; margin: -0 -24px; padding: 14px 24px; border-radius: 8px; margin-bottom: 8px; }
.report-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.report-from { font-size: 13px; }
.report-time { font-size: 11px; color: #80868b; }
.report-status-tag { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.report-status-tag.pending { background: #fef7e0; color: #e37400; }
.report-status-tag.valid { background: #e6f4ea; color: #188038; }
.report-status-tag.invalid { background: #f1f3f4; color: #80868b; }
.report-quoted {
  background: #f8f9fa; padding: 10px 14px; border-radius: 8px; border-left: 3px solid #dadce0;
  font-size: 13px; color: #3c4043; margin: 6px 0;
}
.report-reason { font-size: 12px; color: #5f6368; font-style: italic; }
.report-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---- YOUTUBE EMBEDS ---- */
.yt-embed {
  position: relative; width: 100%; padding-bottom: 56.25%;
  margin: 10px 0 4px; border-radius: 10px; overflow: hidden;
  background: #000;
}
.yt-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none; border-radius: 10px;
}
.yt-embed.small { padding-bottom: 40%; max-width: 400px; }
.post-link { color: #1a73e8; text-decoration: underline; word-break: break-all; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .class-layout { flex-direction: column; }
  .people-sidebar {
    display: none; position: fixed; top: 64px; right: 0; bottom: 0;
    width: 280px; z-index: 200; border-radius: 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1); overflow-y: auto;
  }
  .people-sidebar.open { display: block; }
  .class-grid { grid-template-columns: 1fr; }
  .class-banner h1 { font-size: 24px; }
}
