/* ─── Google Fonts ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Arvo:ital,wght@0,400;0,700;1,400&family=Share+Tech+Mono&display=swap');

/*
  Special Elite  — typewriter display / headings
  Arvo           — sturdy slab serif body, not precious
  Share Tech Mono— status panels, numbers, data
*/

/* ─── Ripped page edge — SVG mask on #content ───────────── */
/* A subtle irregular top edge, like torn newsprint */

/* ─── Light mode ─────────────────────────────────────────── */
body {
  --bg-color:             #B8B49A;
  --border-color:         #2A2A22;
  --content-bg-color:     #D4CFB8;
  --text-color:           #1E1E18;
  --heading-color:        #1A1A14;
  --link-color:           #5C3A1E;
  --link-hover-color:     rgba(0, 0, 0, 0.08);
  --unavailable-bg-color: #A8A490;
  --unavailable-color:    #6A6A5A;
  --tab-bg-color:         #3A3A2E;
  --tab-color:            #484838;
  --tab-hover-color:      #565646;
  --tab-text-color:       #C8C4A8;
  --tab-active-color:     #D4CFB8;
  --card-border-color:    #3A3A2E;
  --card-bg-color:        #A8A490;
  --accent-color:         #7A7A5E;
  --rule-color:           #2A2A22;
  --mono-color:           #3A3A2E;

  font-family: 'Arvo', Georgia, serif;
  background-color: var(--bg-color);
  padding: 0;
  line-height: 158%;
  overflow-y: scroll;
  color: var(--text-color);
}

/* ─── Dark mode ──────────────────────────────────────────── */
body.dark-mode {
  --bg-color:             #1A1A14;
  --border-color:         #6A6A5A;
  --content-bg-color:     #222218;
  --text-color:           #C8C4A8;
  --heading-color:        #D8D4B8;
  --link-color:           #9A7A4E;
  --link-hover-color:     rgba(255, 255, 255, 0.06);
  --unavailable-bg-color: #2A2A22;
  --unavailable-color:    #585848;
  --tab-bg-color:         #111110;
  --tab-color:            #1E1E18;
  --tab-hover-color:      #2A2A22;
  --tab-text-color:       #8A8A72;
  --tab-active-color:     #222218;
  --card-border-color:    #484838;
  --card-bg-color:        #2A2A22;
  --accent-color:         #5A5A46;
  --rule-color:           #484838;
  --mono-color:           #8A8A72;
}
body.dark-mode #content {
  border-color: #484838;
}
body.dark-mode .tools {
  border-color: #484838;
}

/* ─── 1. CORE VARIABLES & BASE STYLES ────────────────────────────────────── */
body.classic-mode {
  --bg-color: #f3f3e3;
  --border-color: #000;
  --content-bg-color: #f3f3f3;
  --text-color: #431;
  --link-color: #900;
  --link-hover-color: rgba(0, 0, 0, 0.05);
  --unavailable-bg-color: rgba(0, 0, 0, 0.1);
  --unavailable-color: #999;
  --tab-bg-color: #dedede;
  --tab-color: #ddd;
  --tab-hover-color: #ececec;
  --card-border-color: #ccc; 
  --card-bg-color: #ddd; 
  
  --heading-color: #431;
  --rule-color: #876; 
  
  font-family: "Minion Pro", Georgia, serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* ─── 2. TYPOGRAPHY OVERRIDES ────────────────────────────────────────────── */
body.classic-mode header h1, 
body.classic-mode header h2,
body.classic-mode #content h1,
body.classic-mode .tools,
body.classic-mode ul.choices li,
body.classic-mode .tab_button,
body.classic-mode #header-links a, 
body.classic-mode #qualities h1, 
body.classic-mode #qualities_2 h1, 
body.classic-mode #qualities_3 h1,
body.classic-mode #qualities_4 h1, 
body.classic-mode #qualities_5 h1, 
body.classic-mode #qualities_6 h1 {
  font-family: "Minion Pro", Georgia, serif;
  letter-spacing: normal;
}

body.classic-mode header h1 { font-weight: bold; }

body.classic-mode #content h1 {
  margin: 2em 0 1em 0;
  font-size: 1.35em;
  text-shadow: rgba(255, 255, 255, 0.75) 2px 2px 2px, rgba(0, 0, 0, 0.1) -1px -1px 2px;
  border: none; 
}

/* ─── 3. MAIN CONTENT AREA ───────────────────────────────────────────────── */
body.classic-mode #content {
  border: none;
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background-color: var(--content-bg-color);
}

body.classic-mode #content::before { display: none; }

body.classic-mode #mid_panel {
  margin: 0 2rem 0 20rem; 
  max-width: 48rem;
}

/* ─── 4. THE UNIFIED SIDEBAR (ANTI-CRUSH FIXES) ──────────────────────────── */
body.classic-mode #tools_wrapper {
  position: absolute;
  width: 16rem; 
  left: 1.5rem;
  top: 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem; 
  pointer-events: none; 
}

body.classic-mode .tools {
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem; /* Uniform padding for all quality panels */
  
  /* Critical Fixes: Stops panels from shrinking or disappearing */
  flex-shrink: 0; 
  min-height: min-content;
  display: block; 
  
  border: 1px solid var(--card-border-color);
  border-radius: 6px;
  background-color: var(--content-bg-color);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

body.classic-mode .tools:hover {
  box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

/* ─── Classic mode tool height fix ──────────────────────── */
body.classic-mode .tools.left {
  max-height: none;
  overflow-y: visible;
  flex: none;
}

body.classic-mode .tools.right {
  flex: none;
  width: 100%;
}

/* ─── 5. UI ELEMENTS & TABS ──────────────────────────────────────────────── */
body.classic-mode .tab_container {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--card-border-color);
  /* Adjusted negative margins to match the 0.8rem panel padding */
  margin: -0.8rem -0.8rem 1rem -0.8rem; 
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

body.classic-mode .tab_button {
  flex: 1 1 auto;
  text-align: center;
  border: none;
  border-right: 1px solid var(--card-border-color);
  background-color: var(--tab-bg-color);
  padding: 0.6rem 0.4rem;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

body.classic-mode ul.choices {
  border: 2px solid #876;
  border-radius: 4px;
}

body.classic-mode a.card, body.classic-mode div.blank-card {
  border-width: 10px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

/* ─── 6. INTERNAL QUALITIES (SIZE PROTECTION) ────────────────────────────── */
body.classic-mode #qualities,
body.classic-mode #qualities_2,
body.classic-mode #qualities_3,
body.classic-mode #qualities_4,
body.classic-mode #qualities_5,
body.classic-mode #qualities_6 {
  /* Prevent microscopic 10px text */
  font-size: 1rem; 
  line-height: 1.5;
  display: block;
  height: auto;
  visibility: visible;
  overflow: visible;
}

body.classic-mode #qualities h1,
body.classic-mode #qualities_2 h1,
body.classic-mode #qualities_3 h1,
body.classic-mode #qualities_4 h1,
body.classic-mode #qualities_5 h1,
body.classic-mode #qualities_6 h1 {
  border-bottom: 1px solid var(--card-border-color);
  padding-bottom: 0.3em;
  margin-bottom: 0.8em;
  color: var(--text-color);
  font-size: 1.05em;
  font-weight: bold;
  text-shadow: none;
  text-align: left;
}

body.classic-mode #qualities_2 img,
body.classic-mode #qualities_3 img,
body.classic-mode #qualities_5 img,
body.classic-mode #qualities_6 img{
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--card-border-color);
}

/* ─── 7. RESPONSIVE FALLBACKS ─────────────────────────────────────────────── */
@media screen and (max-width: 1200px) {
  body.classic-mode #tools_wrapper { width: 14rem; left: 1rem; }
  body.classic-mode #mid_panel { margin: 0 1rem 0 16rem; }
}

@media screen and (max-width: 850px) {
  body.classic-mode #tools_wrapper {
    position: static;
    width: 100%;
    padding: 0 1rem;
    flex-direction: row; 
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 2rem;
  }
  body.classic-mode .tools { width: calc(50% - 0.5rem); }
  body.classic-mode #stats_sidebar_3 { width: 100%; }
  body.classic-mode #stats_sidebar_6 { width: 100%; }
  body.classic-mode #mid_panel { margin: 0 auto; padding: 0 1rem; }
}

@media screen and (max-width: 560px) {
  body.classic-mode #tools_wrapper { flex-direction: column; padding: 0 0.5rem; }
  body.classic-mode .tools, body.classic-mode #stats_sidebar_3 { width: 100%; }
}









/* ─── Page shell ─────────────────────────────────────────── */
#page {
  width: 95%;
  max-width: 95vw;
  margin: 0 auto;
  position: relative;
}

/* ─── Header ─────────────────────────────────────────────── */
header {
  color: var(--heading-color);
  width: 95%;
  max-width: 95vw;
  margin: 0 auto;
  text-align: right;
  overflow: auto;
  padding: 0.3em 0;
  border-bottom: 2px solid var(--rule-color);
  margin-bottom: 0.5em;
}
#header-links {
  text-align: left;
  float: left;
  display: inline-block;
  padding: 0.15em 0;
  background-color: transparent;
}
#header-links a {
  padding-right: 1.2em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
header h1,
header h2 {
  display: inline-block;
  font-weight: normal;
  margin: 0;
  font-size: 0.95em;
  font-family: 'Special Elite', serif;
  letter-spacing: 0.02em;
}
header h1 {
  font-weight: normal; /* Special Elite has its own weight */
}
header h2:before {
  content: "by";
  font-style: italic;
  font-family: 'Arvo', serif;
  padding: 0 0.3em 0 0;
}

/* ─── Main content — ripped top edge ────────────────────── */
/*
 * The ripped effect is achieved with a repeating clip-path
 * on a pseudo-element overlay. Subtle — just enough texture
 * on the top border to suggest torn newsprint.
 */
#content {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--content-bg-color);
  color: var(--text-color);
  font-size: 1.05em;
  padding: 1.4em 1.8em 1.8em 1.8em;
  /* Hard edges — no border-radius anywhere */
  border-left: 3px solid var(--rule-color);
  border-right: 1px solid var(--rule-color);
  border-bottom: 3px solid var(--rule-color);
  /* No top border — the ripped pseudo-element handles it */
  box-shadow: 4px 4px 0px rgba(0,0,0,0.25);
}

/* Ripped top edge — irregular torn paper effect */
#content::before {
  content: '';
  display: block;
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 10px;
  background-color: var(--content-bg-color);
  /* Jagged clip path simulating torn paper */
  clip-path: polygon(
    0% 100%,
    0.8% 20%,
    2.1% 80%,
    3.5% 10%,
    5.0% 70%,
    6.2% 30%,
    7.8% 90%,
    9.1% 15%,
    10.5% 65%,
    12.0% 40%,
    13.3% 85%,
    14.9% 20%,
    16.2% 75%,
    17.8% 35%,
    19.0% 90%,
    20.5% 10%,
    22.0% 60%,
    23.4% 30%,
    24.8% 80%,
    26.3% 20%,
    27.7% 70%,
    29.2% 40%,
    30.6% 85%,
    32.0% 15%,
    33.5% 65%,
    35.0% 35%,
    36.4% 90%,
    37.8% 20%,
    39.3% 75%,
    40.8% 45%,
    42.2% 80%,
    43.7% 25%,
    45.1% 70%,
    46.6% 10%,
    48.0% 60%,
    49.5% 30%,
    51.0% 85%,
    52.4% 20%,
    53.9% 65%,
    55.3% 40%,
    56.8% 90%,
    58.2% 15%,
    59.7% 55%,
    61.2% 30%,
    62.6% 80%,
    64.1% 20%,
    65.5% 70%,
    67.0% 45%,
    68.4% 85%,
    69.9% 25%,
    71.4% 60%,
    72.8% 35%,
    74.3% 80%,
    75.7% 10%,
    77.2% 65%,
    78.6% 40%,
    80.1% 90%,
    81.6% 20%,
    83.0% 70%,
    84.5% 30%,
    85.9% 85%,
    87.4% 15%,
    88.8% 55%,
    90.3% 35%,
    91.8% 75%,
    93.2% 25%,
    94.7% 65%,
    96.1% 40%,
    97.6% 80%,
    98.8% 20%,
    100% 60%,
    100% 100%
  );
  border-left: 3px solid var(--rule-color);
  border-right: 1px solid var(--rule-color);
  pointer-events: none;
}

/* ─── Tools wrapper ──────────────────────────────────────── */
#tools_wrapper {
  position: static;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

/* ─── Tool panels — typewriter feel ─────────────────────── */
.tools {
  padding: 0.5em 0.6em;
  color: var(--text-color);
  background-color: var(--content-bg-color);
  box-sizing: border-box;
  overflow-y: auto;
  border: 1px solid var(--rule-color);
  border-top: 3px solid var(--rule-color);
  box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88em;
}
.tools.left {
  float: none;
  left: auto;
  flex: 1 1 0;
  min-width: 0;
  max-height: 16em;
  overflow-y: auto;
}
.tools.right {
  float: none;
  right: auto;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  font-family: 'Arvo', serif; /* wider panel can use body font */
  font-size: 0.95em;
}

/* ─── Mid panel ──────────────────────────────────────────── */
#mid_panel {
  margin: 0;
}

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  color: var(--text-color);
  width: 95%;
  max-width: 95vw;
  margin: 0.8em auto 0 auto;
  font-size: 0.75em;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.02em;
  position: relative;
  border-top: 1px solid var(--rule-color);
  padding-top: 0.3em;
}
footer a {
  padding-right: 1em;
}

/* ─── Qualities ──────────────────────────────────────────── */
#qualities,
#qualities_2,
#qualities_3,
#qualities_4,
#qualities_5,
#qualities_6 {
  text-indent: 0;
  line-height: 1.45em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9em;
}

#qualities p,
#qualities_2 p,
#qualities_3 p,
#qualities_4 p,
#qualities_5 p,
#qualities_6 p {
  text-indent: 0;
  margin-bottom: 0.4em;
}

#qualities h1,
#qualities_2 h1,
#qualities_3 h1,
#qualities_4 h1,
#qualities_5 h1,
#qualities_6 h1 {
  font-family: 'Special Elite', serif;
  font-size: 0.95em;
  font-weight: normal;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--heading-color);
  border-bottom: 1px solid var(--rule-color);
  padding-bottom: 0.15em;
  margin-bottom: 0.3em;
  text-shadow: none;
}

/* ─── Content headings ───────────────────────────────────── */
#content #read-marker {
  border: none;
  border-top: 1px solid var(--rule-color);
  height: 1px;
  width: 25%;
  clear: left;
  margin: 1em auto;
}
#content h1:first-child {
  margin-top: 0.4em;
}
#content h1 {
  font-family: 'Special Elite', serif;
  margin: 1.6em 0 0.7em 0;
  font-size: 1.4em;
  font-weight: normal;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--heading-color);
  text-shadow: none;
  border-top: 1px solid var(--rule-color);
  border-bottom: 1px solid var(--rule-color);
  padding: 0.25em 0;
}

/* ─── Links ──────────────────────────────────────────────── */
a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ─── Paragraphs ─────────────────────────────────────────── */
p {
  margin: 0;
  margin-bottom: 1em;
  text-indent: 1.5em;
}
p.game-over {
  border: 1px solid var(--rule-color);
  padding: 0.5em;
  margin: 0.5em 0 0 0;
  color: var(--unavailable-color);
  font-style: italic;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9em;
}

/* ─── Choices ────────────────────────────────────────────── */
ul.choices {
  border: 1px solid var(--rule-color);
  border-top: 2px solid var(--rule-color);
  padding: 0;
  margin: 0.5em 0 0 0;
  list-style-type: none;
  clear: left;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.15);
}
ul.choices li {
  border-bottom: 1px solid var(--rule-color);
  padding: 0.45em 0.8em;
  font-family: 'Arvo', serif;
}
ul.choices li div.subtitle {
  margin-left: 2em;
  font-style: italic;
  font-size: 0.88em;
  color: var(--unavailable-color);
  font-family: 'Share Tech Mono', monospace;
}
ul.choices li.unavailable {
  color: var(--unavailable-color);
  background-color: var(--unavailable-bg-color) !important;
  cursor: default !important;
}
ul.choices li:hover {
  background-color: var(--link-hover-color);
  cursor: pointer;
}
ul.choices li:last-child {
  border-bottom: none;
}
ul.choices a {
  text-decoration: none;
  font-weight: 700;
}

/* ─── Blockquotes ────────────────────────────────────────── */
blockquote {
  margin: 1em 2em;
  border-left: 4px solid var(--rule-color);
  padding-left: 1em;
  font-style: italic;
}
blockquote.attribution {
  margin-left: 4em;
  border-left: none;
  padding-left: 0;
  font-size: 0.9em;
  font-family: 'Share Tech Mono', monospace;
  font-style: normal;
}
blockquote + blockquote.attribution {
  margin-top: -0.8em;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.tab_container {
  background-color: var(--tab-bg-color);
  margin-top: -0.5em;
  margin-left: -0.6em;
  margin-right: -0.6em;
  margin-bottom: 0.5em;
}
.tab_button {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background-color: var(--tab-color);
  color: var(--tab-text-color);
  border: none;
  border-right: 1px solid var(--rule-color);
  outline: none;
  padding: 7px 10px;
  cursor: pointer;
}
.tab_button.active {
  background-color: var(--tab-active-color);
  color: var(--heading-color);
}
.tab_button:hover {
  background-color: var(--tab-hover-color);
}

/* ─── Overlay / save ─────────────────────────────────────── */
.overlay {
  background: rgba(0, 0, 0, 0.8);
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  overflow: scroll;
}
.options {
  text-align: right;
}
.overlay_top {
  position: relative;
  max-width: 540px;
  margin: 100px auto;
  background: #1A1A14;
  border: 2px solid #484838;
  color: #C8C4A8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9em;
  padding: 1.2em;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.4);
}
.save_info {
  min-width: 10em;
  font-size: 0.82em;
  color: #7A7A5E;
}

/* ─── Background layers ──────────────────────────────────── */
.background {
  position: fixed;
  width: 100%; height: 100%;
  top: 0; right: 0; bottom: 0; left: 0;
  background-color: var(--bg-color);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  overflow: hidden;
}
#bg2 { z-index: -100; }
#bg1  { z-index: -99; }

/* ─── Cards ──────────────────────────────────────────────── */
ul.decks, ul.hand, ul.pinned-cards {
  list-style: none;
  padding-left: 0;
}
a.card {
  display: inline-block;
  width: 120px;
  height: 150px;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
  border: 6px solid var(--card-border-color);
  margin-bottom: 0.5em;
  position: relative;
}
a.card:hover {
  box-shadow: 6px 6px 0px rgba(0,0,0,0.35);
  left: -3px;
  top: -3px;
}
div.blank-card {
  display: inline-block;
  width: 120px;
  height: 150px;
  background-color: var(--card-bg-color);
  border: 6px solid var(--card-border-color);
  margin-bottom: 0.5em;
}
.card-in-hand, .pinned-card, .deck {
  display: inline-block;
  position: relative;
  max-width: 150px;
  margin-right: 1em;
  vertical-align: top;
}
.unavailable-card {
  color: var(--unavailable-color);
  background-color: var(--unavailable-bg-color) !important;
  cursor: default !important;
}
.card-caption {
  text-align: center;
  display: block;
  font-size: 0.78em;
  font-family: 'Share Tech Mono', monospace;
}
.card-tooltip {
  position: absolute;
  visibility: hidden;
  width: 150px;
  max-width: 200px;
  font-size: 0.82em;
  z-index: 2;
  padding: 0.3em;
  border: 1px solid var(--border-color);
  background-color: var(--content-bg-color);
  left: 105%;
  font-family: 'Share Tech Mono', monospace;
}
.card-img {
  height: 150px;
  width: 120px;
  object-fit: cover;
}
a.card:focus .card-tooltip,
a.card:hover .card-tooltip {
  visibility: visible;
  position: absolute;
}
.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;
}
.face-img {
  vertical-align: bottom;
  object-fit: cover;
}

/* ─── Sprites ────────────────────────────────────────────── */
img {
  max-width: 100%;
  max-height: 100%;
}
#contentSpriteContainer {
  position: fixed;
  width: 100%; height: 100%;
  max-width: 62em;
  left: 0; right: 0;
  margin: 0 auto;
  z-index: -97;
}
.sprite { position: absolute; width: 180px; }
#topLeftSprite    { float: left;  top: -1em; left: 0.4em; }
#topRightSprite   { float: right; top: -1em; right: 0.4em; }
#bottomLeftSprite { float: left;  left: 0.4em; top: 50%; }
#bottomRightSprite{ float: right; right: 0.4em; top: 50%; }

/* ─── Game-specific ──────────────────────────────────────── */
.box {
  display: inline-block;
  height: 1em;
  width: 1em;
}
table {
  border-spacing: 0.4em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88em;
}

/* Australian party colours */
.seat.alp   { fill: #6B2A1A; }
.seat.uap   { fill: #3A3A2E; }
.seat.cp    { fill: #5A5A42; }
.seat.lib   { fill: #2A2A22; }
.seat.other { fill: #7A7A6A; }

/* Weimar compatibility */
.seat.kpd   { fill: #6B0000; }
.seat.spd   { fill: #7A3020; stroke: var(--border-color); stroke-width: 1.5px; }
.seat.ddp   { fill: #C8B040; }
.seat.z     { fill: #1A1A14; }
.seat.bvp   { fill: #5A8A9E; }
.seat.dvp   { fill: #B89020; }
.seat.dnvp  { fill: #3A4A5E; }
.seat.nsdap { fill: #5A3020; }
.seat.sapd  { fill: #A03020; }

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

/* ─── Typewriter effect ──────────────────────────────────── */
.tw {
  opacity: 0;
  animation: tw-fade 0.05s forwards;
}
@keyframes tw-fade {
  to { opacity: 1; }
}

/* ─── Collapsed sidebar ──────────────────────────────────── */
#stats_sidebar_3.collapsed {
  padding-bottom: 0.3em;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media screen and (max-width: 700px) {
  #page, header, footer {
    width: 100%;
    max-width: 100%;
  }
  #content {
    font-size: 1em;
    line-height: 158%;
    padding: 1em 1em 1.5em 1em;
  }
  #tools_wrapper {
    flex-direction: column;
    flex-wrap: wrap;
  }
  .tools.left,
  .tools.right {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }
  #qualities { font-size: 0.9em; }
  .card-img { height: 125px; width: 100px; }
  a.card { width: 100px; height: 125px; border: 5px solid var(--card-border-color); }
  div.blank-card { width: 100px; height: 125px; border: 5px solid var(--card-border-color); }
  .card-in-hand, .pinned-card, .deck { max-width: 120px; }
}















#faction-chart {
    float: left;
    margin-right: 1em;
    margin-bottom: 0.5em;
}


#game-intro-overlay {
    font-family: "Minion Pro", Georgia, serif;
    user-select: none;
    cursor: pointer;
}

/* Hide all three toolboxes by default */
#stats_sidebar, 
#stats_sidebar_2, 
#stats_sidebar_3,
#stats_sidebar_4, 
#stats_sidebar_5, 
#stats_sidebar_6 {
    display: none;
}




#qualities_2 img {
  float: left;
  margin-right: 1em;
  margin-bottom: 0.5em;
  max-width: 80px;
}

#qualities_2 .face-figure {
  float: none;
  display: block;
  max-width: 100%;
  margin: 0 0 0.5em 0;
}







/*/* ─── Dialogue mode ──────────────────────────────────────── */
.dialogue-log {
  margin: 0.8em 0;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.dialogue-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  max-width: 85%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.dialogue-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.dialogue-entry.instant {
  opacity: 1;
  transition: none;
}

.dialogue-entry.left {
  align-self: flex-start;
  flex-direction: row;
}

.dialogue-entry.right {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.dialogue-entry.center {
  align-self: center;
  flex-direction: column;
  align-items: center;
  max-width: 70%;
  text-align: center;
}

.dialogue-portrait {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 2px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
  font-weight: bold;
  color: var(--content-bg-color);
  flex-shrink: 0;
}

.dialogue-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dialogue-bubble {
  background-color: var(--card-bg-color);
  border: 1px solid var(--card-border-color);
  border-top: 2px solid var(--card-border-color);
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  padding: 0.4em 0.7em;
  font-family: 'Arvo', serif;
  font-size: 0.92em;
  line-height: 1.5;
}

.dialogue-bubble .dialogue-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mono-color);
  margin-bottom: 0.25em;
}

.dialogue-entry.right .dialogue-bubble {
  background-color: var(--content-bg-color);
  border-color: var(--rule-color);
}

.dialogue-entry.center .dialogue-bubble {
  background-color: transparent;
  border: none;
  border-top: 1px solid var(--rule-color);
  border-bottom: 1px solid var(--rule-color);
  box-shadow: none;
  font-style: italic;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88em;
  padding: 0.4em 1em;
}

.dialogue-bubble p {
  margin: 0;
  text-indent: 0;
}

/* ─── Dialogue additions ─────────────────────────────────── */

/* aside: portrait-free, left-aligned, italic stage-direction flavour.
   Intentionally mirrors .center tone but left-aligned and less padded. */
.dialogue-entry.aside {
  align-self: flex-start;
  flex-direction: row;
  max-width: 80%;
}

.dialogue-entry.aside .dialogue-bubble {
  background-color: transparent;
  border: none;
  border-left: 2px solid var(--rule-color);
  box-shadow: none;
  font-style: italic;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
  color: var(--mono-color);
  padding: 0.25em 0.7em;
}

.dialogue-entry.aside .dialogue-bubble p {
  margin: 0;
  text-indent: 0;
}

/* timestamp label beneath bubble text */
.dialogue-bubble .dialogue-timestamp {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72em;
  color: var(--mono-color);
  opacity: 0.65;
  margin-top: 0.3em;
  letter-spacing: 0.05em;
}

.dialogue-entry.right .dialogue-bubble .dialogue-timestamp {
  text-align: right;
}

.dialogue-entry.center .dialogue-bubble .dialogue-timestamp {
  text-align: center;
}




/* ─── Newspaper ──────────────────────────────────────────── */

.newspaper {
  font-family: 'Arvo', serif;
  background: #f5f0e8;
  color: #1a1a1a;
  border: 1px solid #c8b89a;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.18);
  margin: 1em auto;
  overflow: hidden;
}

.newspaper-aged {
  background: #e8dfc0;
  filter: sepia(0.25);
}

.newspaper-masthead {
  padding: 0.6em 1em 0.5em;
  text-align: center;
}

.newspaper-name {
  font-family: 'UnifrakturMaguntia', 'Palatino Linotype', serif;
  font-size: 2.2em;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.newspaper-motto {
  font-style: italic;
  font-size: 0.78em;
  opacity: 0.85;
  margin-top: 0.15em;
}

.newspaper-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7em;
  letter-spacing: 0.06em;
  opacity: 0.8;
  margin-top: 0.3em;
}

.newspaper-rule {
  height: 4px;
  background: currentColor;
  opacity: 0.15;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  margin: 0 0.8em;
}

.newspaper-grid {
  display: grid;
  gap: 0;
  padding: 0.6em 0.8em 0.8em;
}

.newspaper-story {
  padding: 0.5em 0.7em;
  position: relative;
  overflow: hidden;
}

.newspaper-story-border {
  border-right: 1px solid #c8b89a;
}

.newspaper-story:last-child {
  border-right: none;
}

.newspaper-headline {
  font-family: 'Arvo', serif;
  font-size: 1.18em;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 0.2em;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.newspaper-subheadline {
  font-style: italic;
  font-size: 0.88em;
  margin-bottom: 0.25em;
  opacity: 0.85;
}

.newspaper-byline {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.65;
  margin-bottom: 0.4em;
  border-top: 1px solid #c8b89a;
  border-bottom: 1px solid #c8b89a;
  padding: 0.15em 0;
}

.newspaper-img {
  width: 100%;
  display: block;
  margin: 0.4em 0 0.15em;
  filter: grayscale(0.6) contrast(1.05);
}

.newspaper-caption {
  font-size: 0.72em;
  font-style: italic;
  opacity: 0.7;
  margin-bottom: 0.4em;
  text-align: center;
}

.newspaper-body {
  font-size: 0.84em;
  line-height: 1.55;
  margin: 0.35em 0;
  text-align: justify;
  text-indent: 1em;
}

.newspaper-body:first-of-type {
  text-indent: 0;
}

.newspaper-pullquote {
  font-size: 1em;
  font-style: italic;
  font-weight: bold;
  border-top: 2px solid #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
  margin: 0.6em 0.4em;
  padding: 0.4em 0.3em;
  text-align: center;
  line-height: 1.35;
}

/* Stamps */
.newspaper-stamp {
  position: absolute;
  top: 0.6em;
  right: 0.6em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7em;
  font-weight: bold;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 2px solid currentColor;
  transform: rotate(6deg);
  opacity: 0.85;
  pointer-events: none;
}

.newspaper-stamp-urgent    { color: #c40000; border-color: #c40000; }
.newspaper-stamp-classified { color: #1a1a1a; border-color: #1a1a1a; }

/* Torn edge */
.newspaper-torn {
  padding-bottom: 0;
}

.newspaper-torn-edge {
  height: 18px;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 6px,
    #f5f0e8 6px,
    #f5f0e8 8px
  );
  border-top: 1px dashed #c8b89a;
  margin-top: 0.3em;
}

/* Modal */
.newspaper-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
}

.newspaper-modal {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  max-width: 700px;
  width: 100%;
}

.newspaper-modal-close {
  position: absolute;
  top: 0.4em;
  right: 0.4em;
  background: #1a1a1a;
  color: #f5f0e8;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 0.85em;
  cursor: pointer;
  z-index: 10;
  font-family: inherit;
}


/* ─── Letter ─────────────────────────────────────────────── */

.letter {
  position: relative;
  font-family: 'Arvo', serif;
  padding: 2em 2.5em 2em 3em;
  border: 1px solid #c8b89a;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  margin: 1em auto;
  overflow: hidden;
  line-height: 1.65;
}

.letter-handwritten {
  font-family: 'Caveat', 'Dancing Script', cursive;
  font-size: 1.05em;
}

.letter-aged {
  background: #e8dfc0;
  filter: sepia(0.2);
}

/* Watermark */
.letter-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.05;
  pointer-events: none;
  transform: rotate(-30deg);
  white-space: nowrap;
}

/* Stamps */
.letter-stamp {
  position: absolute;
  top: 1.2em;
  right: 1.5em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78em;
  font-weight: bold;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  border: 2px solid currentColor;
  transform: rotate(8deg);
  opacity: 0.82;
  pointer-events: none;
}

.letter-stamp-classified { color: #1a1a1a; border-color: #1a1a1a; }
.letter-stamp-urgent     { color: #c40000; border-color: #c40000; }

/* Seal */
.letter-seal {
  position: absolute;
  top: 1em;
  left: 1em;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: #f5f0e8;
  font-weight: bold;
  opacity: 0.88;
  pointer-events: none;
}

/* Margin note */
.letter-margin-note {
  position: absolute;
  left: 0.4em;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center center;
  font-family: 'Caveat', 'Dancing Script', cursive;
  font-size: 0.78em;
  color: #c40000;
  opacity: 0.75;
  white-space: nowrap;
  pointer-events: none;
}

/* Header */
.letter-header {
  margin-bottom: 1.2em;
  font-size: 0.88em;
}

.letter-sender-name {
  font-weight: bold;
  font-size: 1em;
}

.letter-sender-address,
.letter-sender {
  opacity: 0.75;
  font-size: 0.9em;
  line-height: 1.4;
}

.letter-date {
  margin-top: 0.6em;
  font-style: italic;
  opacity: 0.8;
}

.letter-recipient {
  margin-top: 0.6em;
  white-space: pre-line;
}

.letter-reference {
  margin-top: 0.5em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8em;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.letter-subject {
  margin-top: 0.3em;
  font-weight: bold;
  font-size: 0.9em;
  text-decoration: underline;
}

/* Body */
.letter-body {
  margin-bottom: 1.2em;
}

.letter-greeting {
  margin-bottom: 0.8em;
}

.letter-para {
  margin: 0.6em 0;
  text-align: justify;
  text-indent: 1.5em;
}

.letter-para:first-of-type {
  text-indent: 0;
}

/* Closing */
.letter-closing {
  margin-top: 1em;
}

.letter-valediction {
  margin-bottom: 0.5em;
}

.letter-signature {
  font-family: 'Caveat', 'Dancing Script', cursive;
  font-size: 1.6em;
  line-height: 1.2;
  margin: 0.2em 0 0.4em;
}

.letter-signature-img {
  max-height: 60px;
  display: block;
  margin: 0.3em 0;
  filter: contrast(1.2);
}

.letter-ps {
  margin-top: 1em;
  font-size: 0.88em;
  font-style: italic;
  opacity: 0.8;
}

.letter-enclosures {
  margin-top: 0.4em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

/* Modal */
.letter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
}

.letter-modal {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  max-width: 620px;
  width: 100%;
}

.letter-modal-close {
  position: absolute;
  top: 0.4em;
  right: 0.4em;
  background: #1a1a1a;
  color: #f5f0e8;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 0.85em;
  cursor: pointer;
  z-index: 10;
  font-family: inherit;
}
