@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=VT323&display=swap');

/* ===================================================
   MERGED CSS
   Theme/visuals: second CSS (Crimson Text serif, dark/retro/crt modes)
   Layout/structure: first CSS (CSS Grid, sidebar right+sticky,
                     #main_column, #bottom_panel, .stats-box)
   Target HTML: older HTML (#mid_panel, #tools_wrapper, #stats_sidebar, single #qualities)
   =================================================== */

/* =====================================================================
   CRT FLICKER / JITTER ANIMATIONS (kept from second CSS)
   ===================================================================== */
@keyframes crt-jitter {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(0.15px); }
  100% { transform: translateX(0); }
}

@keyframes crt-flicker {
  0%   { opacity: 1; }
  50%  { opacity: 0.985; }
  100% { opacity: 1; }
}

/* =====================================================================
   BODY — Light default
   ===================================================================== */
body {
  --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;

  font-family: "Crimson Text", Georgia, serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 0;
  line-height: 155%;
  overflow-y: scroll;
}

/* =====================================================================
   DARK MODE
   ===================================================================== */
body.dark-mode {
  --bg-color:             #000;
  --border-color:         #fff;
  --content-bg-color:     #242424;
  --text-color:           #efefef;
  --link-color:           #ff8080;
  --link-hover-color:     rgba(255, 255, 255, 0.06);
  --tab-bg-color:         #555555;
  --tab-color:            #505050;
  --tab-hover-color:      #242424;
  --card-border-color:    #4c4c4c;
  --card-bg-color:        #3f3f3f;
}

body.dark-mode #content,
body.dark-mode .stats-box {
  border-style: double;
  border-width: 4px;
  border-color: #888;
}

/* =====================================================================
   RETRO MODE
   ===================================================================== */
body.retro-mode {
  --bg-color:             #1a1510;
  --border-color:         #a89060;
  --content-bg-color:     #211c14;
  --text-color:           #d4bc8a;
  --link-color:           #c8855a;
  --link-hover-color:     rgba(200, 133, 90, 0.12);
  --tab-bg-color:         #2a2218;
  --tab-color:            #332b1e;
  --tab-hover-color:      #2f2820;
  --card-border-color:    #7a6440;
  --card-bg-color:        #241e15;
  --unavailable-bg-color: rgba(255,255,255,0.04);
  --unavailable-color:    #6a5c40;
}

body.retro-mode #content,
body.retro-mode .stats-box {
  border-style: double;
  border-width: 4px;
  border-color: #888;
}

/* =====================================================================
   CRT MODE
   ===================================================================== */
body.crt-mode {
  --bg-color:             #000000;
  --content-bg-color:     #000000;
  --card-bg-color:        #000000;
  --text-color:           #7ecfa0;
  --unavailable-color:    #1f6633;
  --link-color:           #a0dbb8;
  --link-hover-color:     #b8e8cc;
  --border-color:         #2d6645;
  --card-border-color:    #2d6645;
  --tab-bg-color:         #000000;
  --tab-color:            #000000;
  --tab-hover-color:      #000000;
  --unavailable-bg-color: transparent;

  font-family: "VT323", "Courier New", monospace;
  text-shadow:
    0 0 1px rgba(126,207,160,0.6),
    0 0 3px rgba(126,207,160,0.2);
  animation: crt-flicker 8s infinite;
}

body.crt-mode #content,
body.crt-mode .stats-box {
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  animation: crt-jitter 6s infinite linear;
}

/* Scanlines */
body.crt-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015),
    rgba(255,255,255,0.015) 1px,
    rgba(0,0,0,0.02) 2px
  );
  opacity: 0.35;
  z-index: 9999;
}

/* Vignette */
body.crt-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.25) 100%
  );
  z-index: 9998;
}

/* =====================================================================
   PAGE LAYOUT — CSS Grid (from first CSS)
   Older HTML: #page → [#mid_panel (main)] [#stats_sidebar (sidebar)]
   #tools_wrapper and .left/.right classes are overridden by grid.
   ===================================================================== */
#page {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-areas: "main sidebar";
  gap: 20px;
  max-width: 1150px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

/* #mid_panel is the main content column */
#mid_panel {
  grid-area: main;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* =====================================================================
   SIDEBAR — #stats_sidebar.tools.left
   #tools_wrapper is position:static so the sidebar can be pulled out
   into the grid. The sidebar is placed RIGHT via grid-area: sidebar.
   ===================================================================== */
#tools_wrapper {
  position: static;
  width: auto;
  max-width: none;
  left: auto;
  right: auto;
  margin: 0;
}

.tools {
  grid-area: sidebar;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 0;
  color: var(--text-color);
  font-family: "Crimson Text", Georgia, serif;
  background-color: var(--content-bg-color);
  box-shadow: 2px 2px 12px rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  /* Override the float from the original .tools.left */
  float: none !important;
  left: auto !important;
}

.tools::-webkit-scrollbar       { width: 5px; }
.tools::-webkit-scrollbar-track { background: var(--tab-bg-color); }
.tools::-webkit-scrollbar-thumb { background: var(--border-color); }

/* Dark/retro mode sidebar borders */
body.dark-mode .tools  { border-style: double; border-width: 4px; border-color: #888; }
body.retro-mode .tools { border-style: double; border-width: 4px; border-color: #888; }
body.crt-mode .tools   { border: 2px solid var(--border-color); background: var(--bg-color); animation: crt-jitter 6s infinite linear; }

/* =====================================================================
   QUALITIES PANEL (#qualities — single panel in older HTML)
   ===================================================================== */
#qualities {
  padding: 0.6em;
  text-indent: 0;
  line-height: 1.3em;
  flex-grow: 1;
  font-size: 0.88em;
  color: var(--text-color);
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#qualities::-webkit-scrollbar       { width: 4px; }
#qualities::-webkit-scrollbar-track { background: var(--tab-bg-color); }
#qualities::-webkit-scrollbar-thumb { background: var(--border-color); }

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

#qualities h1 {
  font-size: 1.1em;
  font-weight: normal;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: rgba(255,255,255,0.75) 2px 2px 2px, rgba(0,0,0,0.1) -1px -1px 2px;
  margin: 0.5em 0;
}

/* =====================================================================
   HEADER — older HTML: header is a direct child of #mid_panel,
   contains h1, h2, and #header-links (float:left in original).
   ===================================================================== */
header {
  color: var(--text-color);
  font-family: "Playfair Display", Georgia, serif;
  margin-bottom: 20px;
  text-align: right;
  overflow: auto;
}

header h1,
header h2 {
  display: inline-block;
  font-weight: normal;
  margin: 0;
  font-size: 1em;
  font-family: "Playfair Display", Georgia, serif;
}

header h1 {
  font-weight: bold;
}

header h2::before {
  content: "by ";
  font-style: italic;
  padding-right: 0.3em;
}

#header-links {
  text-align: left;
  float: left;
  display: inline-block;
  margin-bottom: 0.5em;
  padding-left: 1em;
  box-shadow: 2px 2px 12px rgba(0,0,0,0.2);
  background-color: var(--bg-color);
  font-family: "Playfair Display", Georgia, serif;
}

#header-links a {
  padding-right: 1em;
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.15s ease;
}

#header-links a:hover {
  text-decoration: underline;
}

/* =====================================================================
   CONTENT PANEL
   ===================================================================== */
#content {
  position: relative;
  background-color: var(--content-bg-color);
  color: var(--text-color);
  font-size: 1.1em;
  padding: 1em 1.5em 1.5em 1.5em;
  box-shadow: 2px 2px 12px rgba(0,0,0,0.2);
  min-height: 500px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* =====================================================================
   BOTTOM PANEL (from first CSS structure)
   ===================================================================== */
#bottom_panel {
  background-color: var(--content-bg-color);
  color: var(--text-color);
  font-size: 1em;
  padding: 1em 1.5em 1.5em 1.5em;
  box-shadow: 2px 2px 12px rgba(0,0,0,0.2);
  min-height: 120px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 25px;
}

#bottom_panel h1,
#bottom_panel h2 {
  margin: 0 0 0.75em 0;
  font-size: 1.2em;
  font-weight: normal;
  font-family: "Playfair Display", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  text-shadow: rgba(255,255,255,0.75) 2px 2px 2px, rgba(0,0,0,0.1) -1px -1px 2px;
}

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

/* =====================================================================
   FOOTER
   ===================================================================== */
footer {
  margin-top: 1em;
  font-size: 0.8em;
  position: relative;
  color: var(--text-color);
}

footer a {
  padding-right: 1em;
}

/* =====================================================================
   TABS
   ===================================================================== */
.tab_container,
.tab_container_bottom {
  background-color: var(--tab-bg-color);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  overflow: hidden;
}

.tab_container_bottom {
  margin-top: auto;
}

.tab_button {
  font-family: "Playfair Display", Georgia, serif;
  background-color: var(--tab-color);
  color: var(--text-color);
  border: none;
  outline: none;
  flex: 1;
  padding: 0.55em 0.2em;
  font-size: 0.72em;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tab_button.active {
  background-color: var(--content-bg-color);
  color: var(--link-color);
}

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

/* =====================================================================
   TYPOGRAPHY
   ===================================================================== */
#content #read-marker {
  border: none;
  border-top: 1px solid var(--border-color);
  height: 1px;
  width: 20%;
  clear: left;
}

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

#content h1 {
  margin: 2em 0 1em 0;
  font-size: 1.35em;
  font-weight: normal;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: rgba(255,255,255,0.75) 2px 2px 2px, rgba(0,0,0,0.1) -1px -1px 2px;
}

#content h2 {
  margin: 1.5em 0 0.75em 0;
  font-size: 1.2em;
  font-weight: normal;
}

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

a:hover {
  text-decoration: underline;
}

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

p.game-over {
  border: 2px solid #bbb;
  padding: 0.5em;
  margin: 0.5em 0 0 0;
  border-radius: 4px;
  color: #999;
}

blockquote {
  margin: 1em 2em;
}

blockquote.attribution {
  margin-left: 4em;
}

blockquote + blockquote.attribution {
  margin-top: -1em;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.8em 0;
  opacity: 0.3;
}

/* =====================================================================
   CHOICE LIST
   ===================================================================== */
ul.choices {
  border: 2px solid #876;
  padding: 0;
  margin: 0.25em 0 0 0;
  list-style-type: none;
  border-radius: 4px;
  clear: left;
}

ul.choices li {
  border-bottom: 1px solid #876;
  padding: 0.5em;
  color: var(--text-color);
  transition: background-color 0.15s ease;
}

ul.choices li div.subtitle {
  margin-left: 2em;
  font-style: italic;
}

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;
}

/* =====================================================================
   OVERLAYS
   ===================================================================== */
.overlay {
  background: rgba(0,0,0,0.7);
  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: var(--content-bg-color);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  padding: 1em;
}

.overlay_top,
.overlay_top table,
.overlay_top td,
.overlay_top label,
.overlay_top input,
.overlay_top button {
  color: var(--text-color);
}

.save_info {
  min-width: 10em;
}

/* =====================================================================
   BUTTONS & FORMS
   ===================================================================== */
button {
  font-family: "Crimson Text", Georgia, serif;
  background-color: var(--tab-bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.35em 0.8em;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.9em;
}

button:hover {
  background-color: var(--link-hover-color);
  color: var(--link-color);
}

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

table {
  border-spacing: 0.5em;
  width: 100%;
  font-family: "Crimson Text", Georgia, serif;
  font-size: 0.95em;
  color: var(--text-color);
}

table td {
  padding: 0.3em 0.5em;
}

/* =====================================================================
   BACKGROUNDS
   ===================================================================== */
.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;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
  margin-bottom: 1.5em;
}

.card-in-hand, .pinned-card, .deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;

}

a.card {
  display: inline-block;
  width: 120px;
  height: 150px;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.2);
  border: 10px solid var(--card-border-color);
  margin-bottom: 0.5em;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.card:hover {
  box-shadow: 10px 10px 10px rgba(0,0,0,0.2);
  transform: translate(-5px, -5px);
}

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

.unavailable-card {
  color: var(--unavailable-color);
  background-color: var(--unavailable-bg-color) !important;
  cursor: default !important;
  opacity: 0.5;
}

.card-caption {
  text-align: center;
  display: block;
  font-size: 1em;
}

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

.card-tooltip {
  position: absolute;
  visibility: hidden;
  width: 150px;
  max-width: 200px;
  font-size: 0.9em;
  z-index: 2;
  padding: 0.2em;
  border: 1px solid var(--border-color);
  background-color: var(--content-bg-color);
  left: 105%;
  top: 0;
  color: var(--text-color);
}

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

/* =====================================================================
   FACE FIGURE
   ===================================================================== */
.face-figure {
  display: inline-block;
  border: 5px 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;
  display: block;
  width: 100%;
  height: auto;
}

/* =====================================================================
   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%; }

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

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

/* =====================================================================
   PARTY / PARLIAMENT SEAT COLORS
   ===================================================================== */
.seat.kpd   { fill: #8B0000; }
.seat.spd   { fill: #E3000F; stroke: var(--border-color); stroke-width: 1.5px; }
.seat.ddp   { fill: #DCCA4A; }
.seat.z     { fill: #000000; }
.seat.bvp   { fill: #69A2BE; }
.seat.dvp   { fill: #D5AC27; }
.seat.other { fill: #909090; }
.seat.dnvp  { fill: #3F7BC1; }
.seat.nsdap { fill: #954B00; }
.seat.sapd  { fill: #C40000; }
.seat.wp    { fill: #363636; }
.seat.cnbl  { fill: #5D4E37; }
.seat.csrp  { fill: #FFCCFF; }
.seat.vrp   { fill: #69413C; }
.seat.csvd  { fill: #5E76FF; }
.seat.srpd  { fill: #FF6B6B; }
.seat.bb    { fill: #36FF64; }
.seat.dhp   { fill: #518A60; }

/* ── Austrian Nationalrat ── */
.seat.sdapo       { fill: #C0392B; }                          /* SDAPÖ — Social Democrats, red */
.seat.kpo         { fill: #8B0000; }                          /* KPÖ — Communists, dark red (replaces .seat.kpoe) */
.seat.cs          { fill: #2E4F9E; }                          /* Christian Socials, deep blue */
.seat.gdvp        { fill: #1A6B4A; }                          /* Greater German People's Party, dark green */
.seat.lb          { fill: #8B6914; }                          /* Landbund, agrarian brown */
.seat.heimatblock { fill: #7D3C98; }                          /* Heimatblock, dark purple */
.seat.jewish      { fill: #D4AF37; }                          /* Jewish List, gold */
.seat.dnsap       { fill: #2C2C2C; }                          /* DNSAP, near-black */



/* NOW FOR ELECTION COLORS

/* Election table row tinting */
tr.row-left     { background-color: rgba(180, 30,  30,  0.10); }
tr.row-center   { background-color: rgba(180, 180, 50,  0.10); }
tr.row-liberal  { background-color: rgba(50,  130, 190, 0.10); }
tr.row-right    { background-color: rgba(60,  90,  180, 0.10); }
tr.row-far-right{ background-color: rgba(149, 75,  0,   0.12); }
tr.row-neutral  { background-color: rgba(120, 120, 120, 0.08); }
tr.row-spd { border: 2px solid #E3000F; }

/* Election table rows — dark mode */
body.dark-mode tr.row-left      { background-color: rgba(180, 30,  30,  0.15); }
body.dark-mode tr.row-center    { background-color: rgba(180, 180, 50,  0.12); }
body.dark-mode tr.row-liberal   { background-color: rgba(50,  130, 190, 0.12); }
body.dark-mode tr.row-right     { background-color: rgba(60,  90,  180, 0.12); }
body.dark-mode tr.row-far-right { background-color: rgba(149, 75,  0,   0.18); }
body.dark-mode tr.row-neutral   { background-color: rgba(120, 120, 120, 0.10); }

/* Election table rows — retro mode */
body.retro-mode tr.row-left      { background-color: rgba(180, 60,  40,  0.18); }
body.retro-mode tr.row-center    { background-color: rgba(160, 140, 50,  0.15); }
body.retro-mode tr.row-liberal   { background-color: rgba(80,  120, 160, 0.15); }
body.retro-mode tr.row-right     { background-color: rgba(70,  100, 160, 0.15); }
body.retro-mode tr.row-far-right { background-color: rgba(140, 80,  20,  0.20); }
body.retro-mode tr.row-neutral   { background-color: rgba(100, 90,  70,  0.12); }

/* Election table rows — CRT mode (nearly invisible tint, let text carry it) */
body.crt-mode tr.row-left      { background-color: rgba(51, 255, 100, 0.06); }
body.crt-mode tr.row-center    { background-color: rgba(51, 255, 100, 0.04); }
body.crt-mode tr.row-liberal   { background-color: rgba(51, 255, 100, 0.04); }
body.crt-mode tr.row-right     { background-color: rgba(51, 255, 100, 0.03); }
body.crt-mode tr.row-far-right { background-color: rgba(51, 255, 100, 0.08); }
body.crt-mode tr.row-neutral   { background-color: rgba(51, 255, 100, 0.02); }

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

@media screen and (max-width: 900px) {
  #page {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
    padding: 10px;
  }

  /* Sidebar drops below main on tablet/mobile */
  .tools {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    float: none !important;
    max-height: none;
    overflow-y: visible;
  }

  header {
    text-align: left;
  }

  #header-links {
    float: none;
    width: 100%;
    padding-left: 0;
  }

  #content { font-size: 1em; }
  #bottom_panel { font-size: 0.95em; }

   ul.decks, ul.hand, ul.pinned-cards {
    grid-template-columns: repeat(3, 1fr);
   }
   
}


@media screen and (max-width: 560px) {
  #page { position: static; }

  #content {
    position: static;
    font-size: 1em;
    line-height: 160%;
    padding: 1em 1em 1.5em 1em;
  }

  #tools_wrapper { position: static; }

  .tools {
    width: 90%;
    margin: 0.4em;
  }

  #bottom_panel { padding: 1em; margin-top: 15px; }

  ul.decks, ul.hand, ul.pinned-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5em;
    justify-items: center;
  }

  .card-img { height: 125px; width: 100px; }
  a.card { width: 100px; height: 125px; border-width: 8px; }
  div.blank-card { width: 100px; height: 125px; border-width: 8px; }
  .card-in-hand, .pinned-card, .deck { max-width: 120px; }

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