/* Minimal CSS for Kolkhoz - Phaser-based game */
/* Only includes styles for lobby page and Phaser canvas */

:root {
  --gold: #c9a961;
  --gold-light: #d4b870;
  --dark: #000;
  --dark-light: #1a1a1a;
  --dark-medium: #2a2a2a;
  --dark-card: #333;
  --transition: 0.2s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--dark);
  font-family: sans-serif;
  color: #fff;
}

/* Phaser canvas container */
#app {
  width: 100%;
  height: 100%;
  position: relative;
}

#app canvas {
  display: block;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: bicubic;
}

/* Lobby page styles */
.page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--dark-light);
  border-bottom: 1px solid var(--dark-card);
}

.top-section {
  color: var(--gold);
  font-size: 14px;
}

/* Main */
main.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  background: var(--dark);
}

.rules-section {
  max-width: 800px;
  width: 90%;
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: var(--dark);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto;
}

.rules-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Buttons */
.button {
  background: var(--gold);
  color: var(--dark);
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: background var(--transition);
}

.button:hover { 
  background: var(--gold-light); 
}

.button-small { 
  padding: 4px 10px; 
  font-size: 12px; 
  margin-left: 12px; 
}

.button-primary {
  background: var(--gold);
  color: var(--dark);
  border: none;
}

.button-primary:hover { 
  background: var(--gold-light); 
}

.button-secondary {
  background: var(--dark-medium);
  color: var(--gold);
  border: none;
}

.button-secondary:hover { 
  background: #3a3a3a; 
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--dark);
  border: 2px solid var(--gold);
  border-radius: 8px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10001;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px 24px;
  border-bottom: 1px solid var(--dark-card);
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover { 
  color: var(--gold-light); 
}

.modal-body { 
  padding: 24px; 
}

.modal-body .rules-section {
  max-width: 100%;
  width: 100%;
  height: 60vh;
  margin: 0;
}

/* Preset buttons */
.preset-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.preset-button {
  flex: 1;
  min-width: 150px;
  padding: 20px 16px;
  background: var(--dark-medium);
  border: 2px solid var(--gold);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: #fff;
  position: relative;
}

.preset-button:hover {
  background: var(--dark-card);
  border-color: var(--gold-light);
  transform: translateY(-2px);
}

.preset-button.active {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold-light);
}

.preset-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--gold);
  margin-bottom: 4px;
}

.preset-button.active .preset-title {
  color: var(--dark);
}

.preset-subtitle {
  font-size: 12px;
  color: #ccc;
}

.preset-button.active .preset-subtitle {
  color: var(--dark);
  opacity: 0.8;
}

.preset-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 1000;
}

.preset-button:hover .preset-tooltip {
  opacity: 1;
  pointer-events: auto;
}

.tooltip-content {
  background: var(--dark-light);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tooltip-content strong {
  display: block;
  color: var(--gold);
  font-size: 16px;
  margin-bottom: 8px;
}

.tooltip-content ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.tooltip-content li {
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0;
  position: relative;
  padding-left: 12px;
}

.tooltip-content li:before {
  content: "•";
  color: var(--gold);
  position: absolute;
  left: 0;
}

/* Russian text translation tooltips */
.russian-text {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--gold);
  text-decoration: none;
}

.russian-text:hover {
  border-bottom-color: var(--gold-light);
}

.translation-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 2000;
  white-space: nowrap;
}

.russian-text:hover .translation-tooltip {
  opacity: 1;
  pointer-events: auto;
}

.translation-tooltip-content {
  background: var(--dark-light);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.translation-tooltip-content:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--gold);
}

.tooltip-content:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gold);
}

.preset-divider {
  text-align: center;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--dark-card);
  border-bottom: 1px solid var(--dark-card);
  color: #999;
  font-size: 14px;
}

/* Variant selection form */
.variant-form {
  display: flex;
  flex-direction: column;
}

.variant-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.variant-option { 
  margin-bottom: 24px;
  break-inside: avoid;
}

.variant-option.full-width {
  grid-column: 1 / -1;
}

.variant-label {
  display: block;
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: bold;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #fff;
}

.radio-label input[type="radio"] {
  margin-right: 8px;
}

.variant-checkbox {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  color: #fff;
}

.variant-checkbox input[type="checkbox"] {
  margin: 0 12px 0 0;
  margin-top: 2px;
}

.checkbox-label {
  font-weight: bold;
  color: var(--gold);
}

.variant-description {
  margin: 0;
  padding-left: 32px;
  color: #ccc;
  font-size: 14px;
  line-height: 1.5;
}

.variant-description ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.variant-description li { 
  margin: 6px 0; 
  color: var(--gold); 
}

.variant-description strong { 
  color: var(--gold); 
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--dark-card);
}

.modal-actions-top {
  border-top: none;
  border-bottom: 1px solid var(--dark-card);
  margin-top: 0;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Mobile responsiveness */
@media (max-width: 900px) {
  header.topbar { 
    padding: 12px 16px; 
    flex-wrap: wrap; 
  }
  
  .top-section { 
    font-size: 12px; 
    margin-bottom: 8px; 
  }
  
  .button { 
    padding: 6px 12px; 
    font-size: 12px; 
  }
  
  .modal-content { 
    width: 95%; 
    max-height: 95vh; 
  }
  
  .modal-header { 
    padding: 16px 16px 12px 16px; 
  }
  
  .modal-header h2 { 
    font-size: 20px; 
  }
  
  .modal-body { 
    padding: 16px; 
  }
  
  .preset-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .preset-button {
    min-width: 100%;
  }
  
  .preset-title {
    font-size: 16px;
  }
  
  .preset-subtitle {
    font-size: 11px;
  }
  
  .preset-tooltip {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 8px;
  }
  
  .tooltip-content:after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--gold);
  }
  
  .tooltip-content {
    min-width: 240px;
    max-width: 280px;
  }
  
  .preset-divider {
    margin: 16px 0;
    padding: 12px 0;
    font-size: 13px;
  }
  
  .variant-options-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .translation-tooltip {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 6px;
  }
  
  .translation-tooltip-content:after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--gold);
  }
  
  .translation-tooltip-content {
    font-size: 11px;
    padding: 5px 8px;
    white-space: normal;
    max-width: 200px;
  }
  
  .variant-description { 
    padding-left: 28px; 
    font-size: 13px; 
  }
  
  .modal-actions { 
    flex-direction: column; 
  }
  
  .modal-actions .button { 
    width: 100%; 
  }
  
  .rules-section { 
    height: 70vh; 
  }
}

@media (max-width: 600px) {
  .rules-section { 
    height: 60vh; 
  }
}
