
:root {
  color-scheme: dark;
  --bg: #090e1b;
  --panel: #111a2c;
  --line: #26344e;
  --text: #f1f5ff;
  --muted: #98a8c3;
  --blue: #7baaff;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 15% 0%, #18244b, transparent 38%),
              radial-gradient(ellipse at 90% 20%, #21183d, transparent 30%), var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
button:disabled { opacity: .6; cursor: not-allowed; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #ffffff12;
  background: #090e1bef;
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.5px;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: #091120;
  background: linear-gradient(135deg, #b8a4ff, #77c5ff);
  border-radius: 12px;
  font-size: 22px;
}
.accent { color: #b9aaff; }
nav { display: flex; gap: 6px; }
.nav-button, .code-button, .secondary-button {
  padding: 9px 13px;
  color: #b8c5db;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}
.nav-button.active, .nav-button:hover {
  color: white;
  background: #ffffff0d;
  border-color: #ffffff12;
}
.code-button, .secondary-button {
  color: var(--text);
  background: #17233a;
  border-color: #30415e;
}
.code-button:hover, .secondary-button:hover { background: #263653; }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.page { padding-bottom: 42px; }
.hero { padding: 58px 0 34px; }
.compact-hero { padding-top: 42px; }
.eyebrow {
  margin-bottom: 10px;
  color: #9eb4dc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.8px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 12px #6ee7b788;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1 {
  margin-bottom: 15px;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.08;
  letter-spacing: -2.5px;
}
.gradient-text {
  color: #b5b8ff;
  background: linear-gradient(100deg, #a7b7ff, #d0a8ff 60%, #82d9ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero > p { max-width: 600px; margin-bottom: 0; color: var(--muted); font-size: 14px; }

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 22px;
  align-items: start;
}
.panel {
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #141e32f5, #0e1728f5);
  box-shadow: 0 18px 50px #00000015;
}
.panel-top, .client-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.5px; }
.pill {
  padding: 5px 8px;
  color: #b8c9e8;
  background: #253653;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}
.muted { color: var(--muted); }
.intro { margin: 20px 0; font-size: 13px; line-height: 1.7; }

.course-head, .course-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 100px 75px 34px;
  gap: 8px;
  align-items: center;
}
.course-head {
  padding: 0 0 9px;
  color: #8294b1;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.course-row { margin-bottom: 9px; }
.course-row input, .course-row select, .gpa-options select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 8px;
  color: var(--text);
  background: #080e1b;
  border: 1px solid #30405d;
  border-radius: 9px;
  font-size: 12px;
}
.remove-course {
  width: 32px;
  height: 35px;
  color: #ffb4c0;
  background: #4a2435;
  border: 1px solid #653348;
  border-radius: 8px;
  font-size: 16px;
}
.course-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; }
.text-button { padding: 7px; color: #a9bcff; background: transparent; border: 0; font-size: 12px; }

.gpa-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #3b4168;
  border-radius: 14px;
  background: radial-gradient(ellipse at top right, #4b3c7735, transparent 70%), #0b1221;
}
.gpa-number { font-size: clamp(40px, 6vw, 56px); font-weight: 850; line-height: 1.15; letter-spacing: -2px; }
#gpa-status { margin: 7px 0 0; font-size: 11px; }
.result-stat { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; color: var(--muted); font-size: 11px; }
.result-stat strong { color: white; text-align: right; font-size: 13px; }
.gpa-options { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 20px; color: #b7c5dd; font-size: 12px; }
.gpa-options select { width: auto; max-width: 60%; }
.small-note { margin: 16px 0 0; color: #8090ac; font-size: 11px; line-height: 1.7; }

.side-column { display: grid; gap: 18px; }
.welcome-panel {
  min-height: 245px;
  background: radial-gradient(ellipse at 100% 0%, #59429b40, transparent 55%), linear-gradient(145deg, #17213a, #101829);
}
.welcome-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  margin-bottom: 19px;
  border-radius: 14px;
  background: #273456;
  font-size: 22px;
}
.welcome-panel h2 { margin-bottom: 10px; font-size: 28px; line-height: 1.15; }
.welcome-panel p, .tips-panel p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.tips-panel { padding: 20px; }
.tips-panel h3 { margin-bottom: 8px; font-size: 15px; }
.tips-panel p { margin-bottom: 0; }
.formula {
  margin-top: 12px;
  padding: 10px;
  color: #c8c5ff;
  background: #080e1b;
  border-radius: 8px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.basic-panel { margin-top: 22px; }
.calculator { max-width: 440px; margin: 20px auto 0; padding: 15px; border: 1px solid #2c3b57; border-radius: 16px; background: #080e1b; }
.calc-history { min-height: 22px; color: #8496b6; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
#calc-display { width: 100%; height: 65px; padding: 8px 0; color: white; background: transparent; border: 0; font-size: 38px; text-align: right; }
.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.key { min-height: 48px; color: #e9efff; background: #18243a; border: 1px solid #263650; border-radius: 10px; font-size: 17px; }
.key:hover { background: #263652; }
.key.utility { color: #b7c7e5; background: #202c43; }
.key.operator { color: #b9c2ff; background: #222748; }
.key.equals { color: #091120; background: linear-gradient(135deg, #b6a5ff, #8ccfff); border: 0; }

.primary-button {
  padding: 12px 16px;
  color: #091120;
  background: linear-gradient(110deg, #b8a5ff, #8bcfff);
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
}
.primary-button:hover { filter: brightness(1.08); }
.full-button { width: 100%; margin-top: 10px; }

.client-panel { padding: 20px; }
.client-toolbar { flex-wrap: wrap; margin-bottom: 17px; }
.client-toolbar h2 { font-size: 19px; }
.client-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.iframe-wrap {
  position: relative;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 420px;
  overflow: hidden;
  background: #000;
  border: 1px solid #35415a;
  border-radius: 13px;
}
#tuffclient-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.iframe-wrap:fullscreen { width: 100vw; height: 100vh; min-height: 0; border: 0; border-radius: 0; background: #000; }
.iframe-wrap:fullscreen #tuffclient-frame { width: 100%; height: 100%; }
.exit-fullscreen-btn {
  display: none;
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  padding: 10px 13px;
  color: white;
  background: #10182be8;
  border: 1px solid #ffffff50;
  border-radius: 9px;
}
.iframe-wrap:fullscreen .exit-fullscreen-btn { display: block; }

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #030611d9;
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(100%, 390px);
  padding: 29px;
  background: #121c30;
  border: 1px solid #34435f;
  border-radius: 19px;
  box-shadow: 0 30px 100px #0009;
}
.modal-card h2 { margin-bottom: 8px; font-size: 25px; }
.modal-card > p { font-size: 13px; }
.modal-card input { width: 100%; padding: 12px; color: white; background: #080e1b; border: 1px solid #34435f; border-radius: 10px; }
.modal-close { position: absolute; top: 10px; right: 14px; color: #aebbd2; background: transparent; border: 0; font-size: 27px; }
.game-message { min-height: 20px; margin: 12px 0 0; color: #aebde0; font-size: 12px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 28px;
  color: #7789a7;
  border-top: 1px solid #ffffff10;
  font-size: 11px;
}

@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-panel { min-height: 0; }
  .side-column .tips-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .topbar { min-height: 62px; padding: 10px 12px; gap: 7px; }
  .brand { gap: 6px; font-size: 14px; }
  .brand-icon { width: 30px; height: 30px; }
  .nav-button, .code-button { padding: 8px; font-size: 10px; }
  .container { width: calc(100% - 22px); }
  .hero { padding: 40px 0 25px; }
  .hero h1 { font-size: 39px; letter-spacing: -1.7px; }
  .hero > p { font-size: 13px; }
  .panel { padding: 15px; border-radius: 14px; }
  .panel-top { align-items: flex-start; }
  .pill { max-width: 115px; text-align: center; }
  .course-head, .course-row { grid-template-columns: minmax(65px, 1fr) 75px 57px 29px; gap: 5px; }
  .course-row input, .course-row select { padding: 6px 4px; font-size: 11px; }
  .remove-course { width: 28px; }
  .gpa-result { padding: 13px; gap: 8px; }
  .gpa-number { font-size: 39px; }
  .result-stat { gap: 5px; font-size: 10px; }
  .side-column { grid-template-columns: 1fr; }
  .side-column .tips-panel:last-child { grid-column: auto; }
  .client-panel { padding: 12px; }
  .client-controls { width: 100%; }
  .client-controls button { flex: 1; }
  .iframe-wrap { height: 68vh; min-height: 350px; }
  footer { width: calc(100% - 22px); }
}
