/* Core Voxel Styles & Symmetrical Grid */
html, body {
    height: 100%;
    overflow: hidden; /* Prevent body scroll to allow local scroll */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center; /* Center container horizontally */
    align-items: flex-start;  /* Align container to top */
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Disable tap highlight on mobile */
}

.container {
    width: 100%;
    max-width: 960px; /* Mobile portrait constraint */
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 2px solid #555;
    background-color: #111;
    display: flex;
    flex-direction: column;
}

/* --- Vote Overlay --- */
.vote-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  animation: fadeIn 0.3s ease-out;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.vote-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.vote-overlay-content {
  background-color: #1f2937;
  border: 1px solid #4b5563;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 42rem;
  width: 100%;
  margin: 1rem;
  aspect-ratio: 2 / 1;
}

.vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  height: 100%;
}

.vote-choice {
  border-width: 2px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  height: 100%;
}

.vote-choice:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.vote-choice-blue { border-color: #3b82f6; }
.vote-choice-red { border-color: #ef4444; }

.vote-checkbox {
  width: 8rem;
  height: 8rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.vote-choice.tapped .vote-checkbox {
    opacity: 1;
}

.vote-checkbox-blue { background-color: #2563eb; }
.vote-checkbox-red { background-color: #dc2626; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 767px) {
  .vote-overlay-content {
      aspect-ratio: auto;
      padding: 1rem;
  }
  .vote-grid {
      gap: 1rem;
  }
  .vote-choice {
      height: auto;
      min-height: 8rem;
  }
  .vote-checkbox {
      width: 100%;
      height: 100%;
      font-size: 3.5rem;
  }
}


#cockpit-header {
    flex-shrink: 0; 
}

#scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
    height: 75vh;
    padding-right: 5px; 
    margin-right: -5px; 
}

#scrollable-content::-webkit-scrollbar { width: 44px; }
#scrollable-content::-webkit-scrollbar-button {
    height: 44px; 
    width: 44px; 
    display: flex; 
    align-items: center;
    justify-content: center;
    background-color: #333;
    border: none;
}
#scrollable-content::-webkit-scrollbar-button:vertical:decrement::after {
    content: ''; display: block; width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
    margin-top: -5px; 
}
#scrollable-content::-webkit-scrollbar-button:vertical:increment::after {
    content: ''; display: block; width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
    margin-bottom: -5px; 
}
#scrollable-content::-webkit-scrollbar-track { background: #222; }
#scrollable-content::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
    border: 2px solid #222; 
}
#scrollable-content::-webkit-scrollbar-thumb:hover { background-color: #777; }
#scrollable-content::-webkit-scrollbar-button:hover { background-color: #444; }

#renderCanvas, #sodomCanvas {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    max-height: 25vh;
    display: block;
    border-radius: 4px;
    background-color: #000;
}

iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: 50vh;
    max-height: 75vh;
    display: block;
    border-radius: 4px;
    background-color: #000;
}

.block {
    border: 1px solid #fff;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card {
    border: 1px solid #333;
    background-color: #222;
    padding: 10px 10px;
    margin: 10px 0;
    cursor: pointer;
}

.card.expanded {
    border-color: #32666c;
}

.card h3 { margin: 0 0 4px 0; }
.card .prompt { font-style: italic; color: #888; font-size: 0.8em; }
.card .definition {
    display: none;
    font-size: 0.9em;
    line-height: 1.5;
    text-align: center;
    margin-top: 15px;
    color: #ccc;
}
.card.expanded .prompt { display: none; }
.card.expanded .definition { display: block; }
h1, h2 {
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 0 0 10px 0;
    font-size: 1.2em;
}
h2 { font-size: 1em; }
.lang-hebrew {
    direction: rtl; text-align: right; font-size: 1.1em;
    font-family: 'Times New Roman', serif; color: #ddd; margin-top: 5px;
}
.lang-greek { font-size: 1.1em; font-family: 'Times New Roman', serif; color: #ddd; margin-top: 5px; }
.card ol { text-align: left; padding-left: 20px; margin-top: 10px; list-style: decimal; }
.card ol li { margin-bottom: 15px; line-height: 1.4; }
p { margin: 0; font-size: 0.9em; color: #aaa; }
.button {
    display: block; width: 100%; padding: 10px; margin-top: 4px;
    background-color: #c00; color: #fff; border: none;
    text-transform: uppercase; font-weight: bold; cursor: pointer; font-size: 1em;
}
.btn { text-decoration: none; color: white; }
#resource-hub { text-align: left; }
#resource-hub h2 { text-align: center; }
#resource-hub details {
    border: 1px solid #444; border-radius: 4px; margin-bottom: 10px;
    background-color: #1a1a1a; transition: background-color 0.2s;
}
#resource-hub details:hover { background-color: #222; }
#resource-hub summary {
    padding: 12px 12px 12px 30px; font-weight: bold; cursor: pointer;
    list-style: none; font-size: 1.1em; position: relative; outline: none;
}
#resource-hub summary::-webkit-details-marker { display: none; }
#resource-hub summary::before {
    content: '►'; position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%) rotate(0deg); transition: transform 0.2s;
    font-size: 0.8em; color: #888;
}
#resource-hub details[open] > summary::before { transform: translateY(-50%) rotate(90deg); }
#resource-hub details[open] > summary { border-bottom: 1px solid #32666c; }
#resource-hub .resource-group { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
#resource-hub .btn {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    padding: 10px 15px; background-color: #333; color: #eee; text-align: left;
    text-decoration: none; border-radius: 4px; font-weight: normal;
    text-transform: none; font-size: 0.95em; box-sizing: border-box; border: 1px solid #444;
}
#resource-hub .btn .desc {
    font-size: 0.8em; color: #999; margin-left: 15px;
    text-align: right; font-style: italic; display: none;
}
@media (min-width: 600px) { #resource-hub .btn .desc { display: inline; } }
#resource-hub .btn:nth-child(odd) { background-color: #383838; }
#resource-hub .card {
    background-color: #252525; text-align: left;
    margin: 10px; border-color: #444;
}
#resource-hub .card h3 { margin-bottom: 8px; font-size: 1em; }
#resource-hub .card .definition, #resource-hub .card p { font-size: 0.9em; color: #ccc; line-height: 1.5; }
.card, .button, .x, .btn {
    transition: transform 0.1s ease-in-out, filter 0.2s, box-shadow 0.2s;
}
.card:hover, .button:hover, .x:hover, .btn:hover {
    transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.card:active, .button:active, .x:active, .btn:active {
    transform: translateY(0); filter: brightness(0.9);
}
#resource-hub .btn:hover {
    background-color: #32666c; color: white; transform: none; filter: none; box-shadow: none;
}
#civic-dashboard .grid {
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; padding: 10px;
    background-color: #0a3a0a; border: 2px solid #c0a080; border-radius: 4px;
}
#civic-dashboard .grid > div {
    aspect-ratio: 1 / 1; display: flex; justify-content: center; align-items: center;
    font-size: clamp(0.6rem, 2vw, 1rem); font-weight: bold; text-transform: uppercase;
    color: #333; user-select: none;
}
#civic-dashboard .x {
    background-color: #fbecd5; border: 1px solid #d4c1a5; border-radius: 3px;
    box-shadow: inset 0 -2px 1px rgba(0,0,0,0.1), 0 2px 2px rgba(0,0,0,0.2); cursor: pointer;
}
#civic-dashboard .x:hover {
    transform: translateY(-2px); filter: brightness(1.05);
    box-shadow: inset 0 -2px 1px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.3);
}
#civic-dashboard .x:active {
    transform: translateY(0); filter: brightness(0.95);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
}
details.section-wrapper {
    border: 1px solid #333; background-color: #1a1a1a;
    margin-bottom: 10px; border-radius: 4px;
}
details.section-wrapper > summary {
    padding: 12px 15px; font-size: 1.2em; font-weight: bold;
    letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
    list-style: none; display: flex; align-items: center; outline: none;
    transition: background-color 0.2s;
}
details.section-wrapper > summary:hover { background-color: #2a2a2a; }
details.section-wrapper > summary::-webkit-details-marker { display: none; }
details.section-wrapper > summary::before {
    content: '►'; margin-right: 10px; font-size: 0.8em; transition: transform 0.2s;
}
details.section-wrapper[open] > summary { border-bottom: 1px solid #32666c; }
details.section-wrapper[open] > summary::before { transform: rotate(90deg); }
.section-wrapper > .block {
    margin-bottom: 0; border-top: none; border-left: none;
    border-right: none; box-shadow: none;
}
.section-wrapper > .block:last-child { border-bottom: none; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; padding: 10px 0;
}
.gallery-item {
  display: block; text-decoration: none; border-radius: 4px;
  overflow: hidden; position: relative; border: 1px solid #444;
}
.gallery-item img {
  width: 100%; height: 150px; object-fit: cover;
  display: block; transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item .title {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.7); color: white; padding: 8px;
  font-size: 0.9em; text-align: center; pointer-events: none;
}
.phrase-display {
    min-height: 50px;
    background-color: #111;
    border: 1px solid #444;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
    color: #eee;
}

/* Migrated Styles from uw-badgersafe.html */

.chart-container {
    position: relative;
    height: 40vh;
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
}

#translator-section .translate-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    #translator-section .translate-container {
        grid-template-columns: 2fr 1fr 2fr;
    }
}
#translator-section .column, #translator-section .fulcrum {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#translator-section .fulcrum {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: center;
}

#translator-section textarea, #translator-section select {
    width: 100%;
    padding: 0.5rem;
    background-color: #3A3A50;
    color: #E0E0E0;
    border: 1px solid #4A4A60;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}
#translator-section .translator-btn {
    padding: 0.5rem;
    cursor: pointer;
    background-color: #64B5F6;
    color: #1A1A2E;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    height: 48px;
}
#translator-section #micButton.active {
    background-color: #FF6B6B;
}

.leftDark, .dugan-section, .syntax-blend, .federal-grants-list, .correlation-section, .federal-funds-section, .republic-compass-framework {
    background-color: #2F4F4F;
    border: 1px solid #708090;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}
.republic-compass-framework ol li {
    margin-bottom: 1.5rem;
}
.law-strong-highlight-blue { color: #64B5F6; font-weight: bold; }
.law-strong-highlight-red { color: #FF6B6B; font-weight: bold; }

/* Game Area (Ransom Scrabble) */
#game-area {
    background-color: #1f2937;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
    row-gap: 1.5rem;
}
#game-area .header-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #374151;
    padding: 1rem;
    border-radius: 0.5rem;
}
@media (min-width: 768px) {
    #game-area .header-controls {
        flex-direction: row;
    }
}
#game-area .score-display {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    #game-area .score-display {
        margin-bottom: 0;
    }
}
#game-area .section-container {
    display: flex;
    flex-direction: column;
    row-gap: 1rem;
}
.ransom-tile {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: #3f51b5;
    border: 2px solid #5c6bc0;
    border-radius: 8px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    cursor: grab;
    user-select: none;
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
    margin: 4px;
    position: relative;
    text-transform: uppercase;
    color: white;
}
.ransom-tile:active {
    cursor: grabbing;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}
.letter-point {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
}
.drop-zone {
    border: 2px dashed #4a5568;
    border-radius: 12px;
    min-height: 80px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    background-color: #2d3748;
    transition: background-color 0.2s ease-in-out;
}
.drop-zone.drag-over {
    background-color: #4a5568;
}
.message-box {
    background-color: #2d3748;
    border: 2px solid #a0aec0;
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    margin-top: 1rem;
}
.message-box button {
    background-color: #3182ce;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    margin-top: 15px;
    cursor: pointer;
}
#custom-letters-input {
    flex-grow: 1;
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #374151;
    color: white;
    border: 1px solid #4b5563;
}