@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;600&family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&display=swap');

/* Base body styles with DEFAULT (light mode) color variables */
body {
  /* Light mode - clinical corporate white (DEFAULT) */
  --bg-color: #f5f7fa;
  --border-color: #2d3748;
  --content-bg-color: #ffffff;
  --text-color: #1a202c;
  --link-color: #2563eb;
  --link-hover-color: rgba(37, 99, 235, 0.08);
  --tab-bg-color: #e2e8f0;
  --tab-color: #f7fafc;
  --tab-hover-color: #cbd5e0;
  --card-border-color: #2d3748;
  --card-bg-color: #ffffff;
  --accent-color: #dc2626;
  --warning-color: #d97706;
  --success-color: #059669;
  --unavailable-bg-color: rgba(220, 38, 38, 0.05);
  --unavailable-color: #6b7280;

  font-family: "IBM Plex Mono", "Courier New", monospace;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 0;
  line-height: 165%;
  overflow-y: scroll;
  letter-spacing: 0.02em;
  
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(45, 55, 72, 0.03) 2px,
      rgba(45, 55, 72, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(45, 55, 72, 0.025) 40px,
      rgba(45, 55, 72, 0.025) 41px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(45, 55, 72, 0.015) 2px,
      rgba(45, 55, 72, 0.015) 4px
    );
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(45, 55, 72, 0.05) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Dark mode - cyberpunk green/cyan theme */
body.dark-mode {
  --bg-color: #0a0e14;
  --border-color: #00ffcc;
  --content-bg-color: #0f1419;
  --text-color: #c7d1db;
  --link-color: #00ffcc;
  --link-hover-color: rgba(0, 255, 204, 0.08);
  --unavailable-bg-color: rgba(255, 0, 0, 0.05);
  --unavailable-color: #4a5562;
  --tab-bg-color: #161b22;
  --tab-color: #0d1117;
  --tab-hover-color: #1c2128;
  --card-border-color: #00ffcc;
  --card-bg-color: #0f1419;
  --accent-color: #ff0066;
  --warning-color: #ffaa00;
  --success-color: #00ff88;
  
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 204, 0.03) 2px,
      rgba(0, 255, 204, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(0, 255, 204, 0.02) 40px,
      rgba(0, 255, 204, 0.02) 41px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 204, 0.01) 2px,
      rgba(0, 255, 204, 0.01) 4px
    );
}

body.dark-mode::before {
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* Light mode specific overrides */
body:not(.dark-mode) #content {
  box-shadow: 
    0 0 0 1px #e2e8f0,
    0 4px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-left: 3px solid var(--border-color);
}

body:not(.dark-mode) #bottom_panel {
  box-shadow: 
    0 0 0 1px #e2e8f0,
    0 4px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-left: 3px solid var(--border-color);
}

body:not(.dark-mode) #header-links a {
  border-left: 1px solid rgba(45, 55, 72, 0.12);
}

body:not(.dark-mode) ul.choices {
  border: 1px solid #cbd5e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

body:not(.dark-mode) ul.choices li {
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff;
}

body:not(.dark-mode) ul.choices li:hover {
  background-color: var(--link-hover-color);
  border-left: 3px solid var(--link-color);
}

body:not(.dark-mode) .stats-box {
  box-shadow: 
    0 0 0 1px #e2e8f0,
    0 4px 20px rgba(0, 0, 0, 0.08);
}

body:not(.dark-mode) #qualities h1, 
body:not(.dark-mode) #qualities_2 h1 {
  border-bottom: 1px solid #e2e8f0;
}

body:not(.dark-mode) .tab_container, 
body:not(.dark-mode) .tab_container_bottom {
  border-bottom: 1px solid #cbd5e0;
}

body:not(.dark-mode) .tab_button {
  border-right: 1px solid rgba(45, 55, 72, 0.1);
}

body:not(.dark-mode) a.card {
  box-shadow: 
    0 0 0 2px #cbd5e0,
    0 4px 12px rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) a.card:hover {
  box-shadow: 
    0 0 0 2px var(--link-color),
    0 8px 20px rgba(37, 99, 235, 0.2);
}

body:not(.dark-mode) blockquote {
  border-left: 3px solid #cbd5e0;
  opacity: 0.75;
}

body:not(.dark-mode) hr {
  border-top: 1px solid #e2e8f0;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes glitch-text {
  0% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.05em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
  14% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.05em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
  15% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
  49% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
  50% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75); }
  99% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75); }
  100% { text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em -0.05em 0 rgba(0, 0, 255, 0.75); }
}

/* RESTRUCTURED LAYOUT - SINGLE #page DEFINITION */
#page {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "title settings"
    "main right-panel";
  gap: 25px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

/* GAME TITLE - upper left */
header {
  grid-area: title;
  margin-bottom: 0;
}

#header-text h1, #header-text h2 {
  display: block;
  font-weight: normal;
  margin: 0;
  font-family: "Orbitron", sans-serif;
}

#header-text h1 {
  font-weight: 900;
  font-size: 1.6em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--link-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3em;
  animation: glitch-text 3s infinite;
}

#header-text h1:hover {
  animation: glitch 0.3s infinite, glitch-text 0.5s infinite;
}

#header-text h2 {
  font-size: 0.75em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  font-weight: 400;
  color: var(--text-color);
}

#header-text h2:before {
  content: "▸ ";
  font-style: normal;
  padding: 0 0.5em 0 0;
  color: var(--link-color);
}

/* SETTINGS - upper right, separated from title */
#header-links {
  grid-area: settings;
  justify-self: end;
  display: flex;
  flex-direction: row;
  gap: 0;
  box-shadow: 
    0 0 0 1px var(--border-color),
    0 4px 16px rgba(0, 0, 0, 0.3);
  background-color: var(--tab-bg-color);
  border: none;
  font-family: "Rajdhani", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#header-links a {
  padding: 0.8em 1.2em;
  transition: all 0.2s ease;
  border-left: 1px solid rgba(0, 255, 204, 0.2);
  font-size: 0.85em;
  color: var(--text-color);
}

#header-links a:first-child {
  border-left: none;
}

#header-links a:hover {
  background-color: var(--link-hover-color);
  color: var(--link-color);
  box-shadow: inset 0 -2px 0 var(--link-color);
}

/* MAIN COLUMN - center content */
#main_column {
  grid-area: main;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

/* BOTTOM PANEL - news/additional content below main */
#bottom_panel {
  background-color: var(--content-bg-color);
  color: var(--text-color);
  font-size: 0.95em;
  padding: 2em 3em;
  box-shadow: 
    0 0 0 1px var(--border-color),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  min-height: 250px;
  border-left: 3px solid var(--border-color);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 25px;
}

#bottom_panel h1 {
  margin: 0 0 1.5em 0;
  font-size: 1.2em;
  font-weight: 700;
  font-family: "Rajdhani", sans-serif;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--link-color);
  border-left: 4px solid var(--link-color);
  padding-left: 1em;
  text-shadow: none;
}

#bottom_panel h1::before {
  content: "◆ ";
  color: var(--accent-color);
  margin-right: 0.5em;
}

#bottom_panel p {
  margin: 0;
  margin-bottom: 1.2em;
  text-indent: 0;
  text-align: justify;
  color: var(--text-color);
}

/* RIGHT PANEL - info panel with proper sizing */
.tools {
  grid-area: right-panel;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 0;
  color: var(--text-color);
  background-color: transparent;
  box-shadow: none;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar styling for right panel */
.tools::-webkit-scrollbar {
  width: 6px;
}

.tools::-webkit-scrollbar-track {
  background: var(--tab-bg-color);
}

.tools::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.tools::-webkit-scrollbar-thumb:hover {
  background: var(--link-color);
}

#content {
  background-color: var(--content-bg-color);
  color: var(--text-color);
  font-size: 1em;
  padding: 2.5em 3em;
  box-shadow: 
    0 0 0 1px var(--border-color),
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  min-height: 500px;
  border-left: 3px solid var(--border-color);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#content::before {
  content: "[ CLASSIFIED CLEARANCE LEVEL: Ω ]";
  position: absolute;
  top: 1em;
  right: 2em;
  font-size: 0.65em;
  color: var(--accent-color);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.1em;
  opacity: 0.4;
  text-transform: uppercase;
}

footer {
  margin-top: 1em;
  font-size: 0.75em;
  position: relative;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
  color: var(--text-color);
}

footer a {
  padding-right: 1em;
}

#content #read-marker {
  border: none;
  border-top: 1px solid var(--border-color);
  height: 1px;
  width: 30%;
  clear: left;
  margin: 2em auto;
  opacity: 0.3;
}

#content h1:first-child {
  margin-top: 0.5em;
}

#content h1 {
  margin: 2.5em 0 1.5em 0;
  font-size: 1.3em;
  font-weight: 700;
  font-family: "Rajdhani", sans-serif;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--link-color);
  border-left: 4px solid var(--link-color);
  padding-left: 1em;
  text-shadow: none;
}

#content h1::before {
  content: "◆ ";
  color: var(--accent-color);
  margin-right: 0.5em;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

a:hover {
  text-shadow: 0 0 8px var(--link-color);
}

p {
  margin: 0;
  margin-bottom: 1.2em;
  text-indent: 0;
  text-align: justify;
  color: var(--text-color);
}

p.game-over {
  border: 2px solid var(--accent-color);
  padding: 1em;
  margin: 1em 0;
  border-radius: 0;
  color: var(--accent-color);
  background: rgba(255, 0, 102, 0.05);
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  font-weight: 700;
}

ul.choices {
  border: 1px solid var(--border-color);
  padding: 0;
  margin: 1em 0 0 0;
  list-style-type: none;
  border-radius: 0;
  clear: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

ul.choices li {
  border-bottom: 1px solid rgba(0, 255, 204, 0.2);
  padding: 1em 1.2em;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05em;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-color);
}

ul.choices li::before {
  content: "▹";
  color: var(--link-color);
  margin-right: 0.8em;
  transition: all 0.2s ease;
}

ul.choices li:hover::before {
  content: "▸";
  margin-right: 1em;
}

ul.choices li div.subtitle {
  margin-left: 2.5em;
  font-style: italic;
  font-size: 0.9em;
  opacity: 0.7;
  font-family: "IBM Plex Mono", monospace;
}

ul.choices li.unavailable {
  color: var(--unavailable-color);
  background-color: var(--unavailable-bg-color) !important;
  cursor: not-allowed !important;
  text-decoration: line-through;
  opacity: 0.4;
}

ul.choices li.unavailable::before {
  content: "✕";
  color: var(--accent-color);
}

ul.choices li:hover {
  background-color: var(--link-hover-color);
  cursor: pointer;
  border-left: 3px solid var(--link-color);
  padding-left: calc(1.2em - 3px);
}

ul.choices li:last-child {
  border-bottom: none;
}

blockquote {
  margin: 1.5em 2em;
  padding-left: 1em;
  border-left: 3px solid var(--border-color);
  font-style: italic;
  opacity: 0.85;
  color: var(--text-color);
}

/* Stats Boxes - properly sized */
.stats-box {
  background-color: var(--content-bg-color);
  padding: 0;
  box-shadow: 
    0 0 0 1px var(--border-color),
    0 8px 32px rgba(0, 0, 0, 0.4);
  border: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 260px;
}

#qualities, #qualities_2 {
  padding: 1em;
  text-indent: 0;
  line-height: 1.4em;
  flex-grow: 1;
  font-size: 0.85em;
  color: var(--text-color);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#qualities::-webkit-scrollbar, #qualities_2::-webkit-scrollbar {
  width: 4px;
}

#qualities::-webkit-scrollbar-track, #qualities_2::-webkit-scrollbar-track {
  background: var(--tab-bg-color);
}

#qualities::-webkit-scrollbar-thumb, #qualities_2::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

#qualities p, #qualities_2 p {
  text-indent: 0;
  margin-bottom: 0.8em;
  text-align: left;
  color: var(--text-color);
}

#qualities h1, #qualities_2 h1 {
  font-size: 0.9em;
  font-weight: 700;
  font-family: "Orbitron", sans-serif;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-shadow: none;
  color: var(--link-color);
  margin: 0 0 1em 0;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

/* Tabs */
.tab_container, .tab_container_bottom {
  background-color: var(--tab-bg-color);
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  flex-wrap: nowrap;
  overflow: hidden;
}

.tab_button {
  font-family: "Rajdhani", sans-serif;
  font-weight: 500;
  background-color: var(--tab-color);
  color: var(--text-color);
  border: none;
  outline: none;
  flex: 1;
  padding: 0.6em 0.3em;
  font-size: 0.7em;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  border-right: 1px solid rgba(0, 255, 204, 0.1);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tab_button:last-child {
  border-right: none;
}

.tab_button.active {
  background-color: var(--content-bg-color);
  color: var(--link-color);
  box-shadow: inset 0 -2px 0 var(--link-color);
}

.tab_button:hover {
  background-color: var(--tab-hover-color);
  color: var(--link-color);
}

.tab_container_bottom {
  border-bottom: none;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Overlays */
.overlay {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  overflow: scroll;
}

.overlay_top {
  position: relative;
  max-width: 600px;
  margin: 100px auto;
  background: var(--content-bg-color);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  box-shadow: 
    0 0 40px rgba(0, 255, 204, 0.3),
    0 16px 64px rgba(0, 0, 0, 0.8);
  padding: 2em;
}

.overlay-title {
  font-family: "Orbitron", sans-serif;
  text-align: center;
  font-size: 1.2em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--link-color);
  margin-bottom: 1.5em;
  padding-bottom: 0.8em;
  border-bottom: 2px solid var(--border-color);
}

table {
  border-spacing: 0.8em;
  width: 100%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9em;
  color: var(--text-color);
}

table td {
  padding: 0.5em;
}

button {
  font-family: "Rajdhani", sans-serif;
  font-weight: 500;
  background-color: var(--tab-bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.6em 1.2em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
}

button:hover {
  background-color: var(--link-hover-color);
  color: var(--link-color);
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.3);
  border-color: var(--link-color);
}

input[type="radio"] {
  accent-color: var(--link-color);
}

hr {
  border: none;
  border-top: 1px solid rgba(0, 255, 204, 0.2);
  margin: 0.5em 0;
}

/* Cards */
ul.decks, ul.hand, ul.pinned-cards {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin-bottom: 1.5em;
}

.card-in-hand, .pinned-card, .deck {
  display: inline-block;
  position: relative;
  width: 120px;
  height: 180px;
  margin-right: 0;
  vertical-align: top;
}

a.card {
  display: block;
  width: 120px;
  height: 150px;
  box-shadow: 
    0 0 0 2px var(--card-border-color),
    0 8px 24px rgba(0, 0, 0, 0.5);
  border: none;
  margin-bottom: 0.5em;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

a.card:hover {
  box-shadow: 
    0 0 0 2px var(--link-color),
    0 12px 32px rgba(0, 255, 204, 0.4),
    0 0 24px rgba(0, 255, 204, 0.2);
  transform: translateY(-4px);
}

a.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.3), transparent);
  transition: left 0.5s ease;
}

a.card:hover::before {
  left: 100%;
}

div.blank-card {
  display: block;
  width: 120px;
  height: 150px;
  background-color: var(--card-bg-color);
  border: 2px solid var(--card-border-color);
  margin-bottom: 0.5em;
  opacity: 0.3;
}

.card-img {
  height: 150px;
  width: 120px;
  object-fit: cover;
  display: block;
}

.card-caption {
  text-align: center;
  display: block;
  font-size: 0.85em;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  margin-top: 0.5em;
  line-height: 1.2em;
  height: 2.4em;
  overflow: hidden;
  color: var(--text-color);
}

.card-tooltip {
  position: absolute;
  visibility: hidden;
  width: 200px;
  max-width: 250px;
  font-size: 0.9em;
  z-index: 2;
  padding: 0.8em;
  border: 1px solid var(--border-color);
  background-color: var(--content-bg-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  left: 105%;
  top: 0;
  color: var(--text-color);
}

a.card:focus .card-tooltip, 
a.card:hover .card-tooltip {
  visibility: visible;
  position: absolute;
}

.unavailable-card {
  color: var(--unavailable-color);
  background-color: var(--unavailable-bg-color) !important;
  cursor: not-allowed !important;
  opacity: 0.3;
  filter: grayscale(100%);
}

.face-figure {
  display: inline-block;
  border: 3px solid var(--card-border-color);
  float: left;
  max-width: 35%;
  margin-right: 1em;
  margin-bottom: 0.5em;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.face-img {
  vertical-align: bottom;
  object-fit: cover;
  display: block;
  width: 100%;
  height: auto;
}

.background {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  overflow: hidden;
}

#bg2 {
  z-index: -100;
}

#bg1 {
  z-index: -99;
}

.box {
  display: inline-block;
  height: 1em;
  width: 1em;
  border: 1px solid var(--border-color);
}

/* Responsive */
@media screen and (max-width: 1200px) {
  #page {
    grid-template-columns: 1fr 220px;
    gap: 15px;
  }
  
  .tools {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
  }
  
  .stats-box {
    max-width: 220px;
  }
  
  #content {
    padding: 2em;
  }
}

@media screen and (max-width: 900px) {
  #page {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "settings"
      "main"
      "right-panel";
    padding: 10px;
  }
  
  header {
    justify-self: start;
  }
  
  #header-links {
    justify-self: start;
    width: 100%;
  }
  
  .tools {
    position: static;
    width: 100%;
    max-width: 100%;
    gap: 15px;
    max-height: none;
    overflow-y: visible;
  }
  
  .stats-box {
    width: 100%;
    max-width: 100%;
  }
  
  #qualities, #qualities_2 {
    max-height: 300px;
  }
  
  #content {
    font-size: 0.95em;
    padding: 1.5em;
  }
  
  #bottom_panel {
    padding: 1.5em;
    font-size: 0.9em;
  }
  
  #header-text h1 {
    font-size: 1.3em;
  }
}

@media screen and (max-width: 560px) {
  #content {
    padding: 1.2em;
  }
  
  #bottom_panel {
    padding: 1.2em;
    font-size: 0.85em;
    margin-top: 15px;
  }
  
  #content::before {
    font-size: 0.5em;
    top: 0.8em;
    right: 1em;
  }
  
  ul.decks, ul.hand, ul.pinned-cards {
    gap: 0.5em;
    justify-content: center;
  }

  .card-img {
    height: 125px;
    width: 100px;
  }
  
  a.card {
    width: 100px;
    height: 125px;
    margin-bottom: 0.5em;
  }
  
  div.blank-card {
    width: 100px;
    height: 125px;
    margin-bottom: 0.5em;
  }
  
  .card-in-hand, .pinned-card, .deck {
    width: 100px;
    height: 155px;
    max-width: 120px;
    margin-right: 0;
  }

  .card-tooltip {
    left: auto;
    right: auto;
    top: 100%;
    width: 90vw;
    max-width: 300px;
  }
}

/* Game-specific styles */
.seat.kpd {
  fill: #8B0000;
}
.seat.spd {
  fill: #E3000F;
  stroke: var(--border-color);
  stroke-width: 1.5px;
}
.seat.ddp {
  fill: #DCCA4A;
}
.seat.z {
  fill: #000;
}
.seat.bvp {
  fill: #69A2BE;
}
.seat.dvp {
  fill: #D5AC27;
}
.seat.other {
  fill: #909090;
}
.seat.dnvp {
  fill: #3F7BC1;
}
.seat.nsdap {
  fill: #954B00;
}
.seat.sapd {
  fill: #C40000;
}

.tooltip-text {
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: help;
}
