:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --card: #f1f3f4;
  --sidebar: #f8fafd;
  --line: #e0e0e0;
  --text: #202124;
  --muted: #5f6368;
  --blue: #1a73e8;
  --selected: #d3e3fd;
  --unread: #202124;
  --hover: #eef3fd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef4ff 0%, #dfe9ff 100%);
  z-index: 20;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.landing-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-card {
  width: min(650px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  padding: 42px 36px;
  text-align: center;
}

.landing-kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1a73e8;
  font-size: 0.8rem;
  font-weight: 700;
}

.landing-card h1 {
  margin: 0 0 18px;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  color: #111827;
}

.landing-copy {
  margin: 0 auto 28px;
  max-width: 460px;
  line-height: 1.7;
  color: #374151;
  font-size: 1.05rem;
}

.landing-infographic {
  display: block;
  width: min(100%, 650px);
  height: auto;
  margin: 0 auto 24px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.get-started-button {
  border: 0;
  border-radius: 999px;
  background: #1a73e8;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.25);
  text-decoration: none;
  display: inline-block;
}

.results-page-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff 0%, #dfe9ff 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.results-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.results-card {
  width: min(560px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  padding: 36px 28px;
  text-align: center;
}

.results-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1a73e8;
  font-size: 0.72rem;
  font-weight: 700;
}

.results-card h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: #111827;
}

.score-ring {
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 700;
  border: 12px solid #dfe7f5;
  background: #f8fbff;
}

.score-ring.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.score-ring.warning {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.score-ring span {
  font-size: 2.1rem;
  line-height: 1;
}

.score-ring small {
  margin-top: 6px;
  font-size: 0.8rem;
  color: inherit;
}

.results-message {
  margin: 0 0 10px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #374151;
}

.results-note {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.hint-panel {
  margin: 0 0 24px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}

.hint-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.hint-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.hint-list li {
  margin-bottom: 10px;
}

.hint-list strong {
  display: block;
  margin-bottom: 4px;
}

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

.primary-action,
.secondary-action {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  background: #1a73e8;
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.error-page-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff 0%, #dfe9ff 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.error-card {
  width: min(560px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  padding: 36px 28px;
  text-align: center;
}

.error-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1a73e8;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.error-card h1 {
  margin: 20px 0 14px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: #111827;
}

.error-message {
  margin: 0 0 12px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #374151;
}

.error-detail {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

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

.topbar {
  height: 64px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.msoe-logo {
  display: block;
  object-fit: contain;
}

.msoe-logo-header {
  width: 40px;
  height: 52px;
}

.msoe-logo-page {
  position: absolute;
  top: 20px;
  left: 24px;
  width: 80px;
  height: 102px;
  z-index: 21;
}

.msoe-logo-landing {
  width: 80px;
  height: 102px;
  margin: 0 auto 14px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--card);
}

.searchbar-wrap {
  flex: 1;
  max-width: 720px;
  height: 48px;
  background: #eaf1fb;
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
}

.searchbar-wrap input {
  background: transparent;
  border: 0;
  width: 100%;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dfe7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.content-shell {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  padding: 14px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.compose-button {
  width: 140px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: #c2e7ff;
  color: #001d35;
  font-weight: 600;
  margin: 10px 12px 18px;
  cursor: pointer;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 0 18px 18px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-item.active {
  background: #d3e3fd;
  color: var(--text);
  font-weight: 600;
}

.badge {
  background: #dfe7f5;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
}

.mail-panel {
  flex: 1;
  display: flex;
  min-width: 0;
  height: 100%;
}

.mail-list-panel {
  width: 440px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.toolbar-row {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--muted);
  border-radius: 3px;
}

.mail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f4;
  text-decoration: none;
  color: inherit;
}

.mail-row:hover {
  background: var(--hover);
}

.mail-row.selected {
  background: var(--selected);
}

.sender-col {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-col {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  overflow: hidden;
}

.subject-col strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subject-col span {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.time-col {
  text-align: right;
  color: var(--muted);
  font-size: 0.8rem;
}

.email-preview-panel {
  flex: 1;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.preview-sender {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.preview-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.preview-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.preview-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 8px 12px;
  cursor: pointer;
}

.decision-panel {
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.decision-panel-top-right {
  margin-left: auto;
  width: fit-content;
}

.decision-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 8px;
  border-radius: 16px;
  background: #eff6ff;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.12);
}

.decision-button,
.finish-game-button {
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.decision-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.decision-button.phishing-option.selected {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.decision-button.safe-option.selected {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #009900;
}

.decision-button.spam-option.selected {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #ff9933;
}

.finish-game-button {
  border: 0;
  background: #1a73e8;
  color: white;
  align-self: flex-end;
}

iframe {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: white;
}

.report-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.report-modal.visible {
  display: flex;
}

.report-modal-card {
  width: min(420px, calc(100vw - 32px));
  background: white;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
  padding: 20px;
}

.report-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 1.2rem;
}

.report-modal-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.report-modal-card p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: var(--text);
}

.close-modal {
  border: 0;
  background: #111827;
  color: white;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

.email-input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.email-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state,
.preview-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

@media (max-width: 980px) {
  .mail-panel {
    flex-direction: column;
  }

  .mail-list-panel {
    width: 100%;
    max-height: 44vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar {
    display: none;
  }
}
