/* =============================
   Isometric Game Engine UI CSS
   ============================= */

:root {
  --game-bg: #2e3b47;
  --game-accent: #4fc3f7;
  --game-text: #fff;
  --game-border-radius: 14px;
  --game-shadow: 0 4px 24px rgba(0,0,0,0.3);
  --game-menu-bg: rgba(34, 45, 56, 0.98);
  --game-dialog-bg: rgba(30, 36, 44, 0.97);
  --game-btn-bg: #4fc3f7;
  --game-btn-bg-hover: #0288d1;
  --game-btn-text: #fff;
  --game-btn-radius: 8px;
  --game-btn-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* WordPress Container Fixes */
.iso-game-container {
  position: relative;
  /* width and height are set by inline style from JS */
  max-width: none;
  max-height: none;
  margin: 40px auto;
  box-shadow: var(--game-shadow);
  background: var(--game-bg);
  border-radius: var(--game-border-radius);
  overflow: hidden;
}

.iso-game-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Game Container */
#game-container {
  position: relative;
  /* width and height are set by inline style from JS */
  margin: 0 auto;
  box-shadow: var(--game-shadow);
  background: var(--game-bg);
  border-radius: var(--game-border-radius);
  overflow: hidden;
}

#game-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* UI Manager Container */
.game-ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.game-ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/* Overlay: Start Screen */
.game-start-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--game-menu-bg);
  z-index: 20;
  transition: opacity 0.3s;
}

.game-start-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  z-index: -1;
}

.game-start-content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
}

.game-start-title {
  color: var(--game-text);
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.game-menu {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.game-menu-item {
  background: var(--game-btn-bg);
  color: var(--game-btn-text);
  border: none;
  border-radius: var(--game-btn-radius);
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--game-btn-shadow);
  transition: background 0.2s, transform 0.1s;
}
.game-menu-item:hover, .game-menu-item:focus {
  background: var(--game-btn-bg-hover);
  outline: none;
  transform: translateY(-2px) scale(1.04);
}

/* Overlay: Dialog */
.game-dialog {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  min-width: 260px;
  max-width: 90%;
  background: var(--game-dialog-bg);
  color: var(--game-text);
  border-radius: var(--game-border-radius);
  box-shadow: var(--game-shadow);
  padding: 1.5rem 2rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1rem;
  animation: fadeIn 0.3s;
}

.game-dialog-text {
  margin-bottom: 1rem;
  text-align: center;
}

.game-dialog-continue {
  display: none;
  margin-top: 0.5rem;
  color: var(--game-accent);
  font-size: 1.2rem;
}

/* Overlay: Notification */
.game-notification {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--game-accent);
  color: var(--game-btn-text);
  padding: 0.75rem 2rem;
  border-radius: var(--game-btn-radius);
  box-shadow: var(--game-btn-shadow);
  z-index: 40;
  font-size: 1.1rem;
  opacity: 0.95;
  animation: fadeIn 0.3s;
}

/* Overlay: Loading Screen */
.game-loading-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--game-menu-bg);
  z-index: 50;
}

/* Overlay: Pause Menu */
.game-pause-menu {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30,36,44,0.92);
  z-index: 60;
}

/* Overlay: Credits */
.game-credits-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(34, 45, 56, 0.96);
  z-index: 100;
  transition: opacity 0.3s;
}

.game-credits-modal {
  background: var(--game-dialog-bg);
  color: var(--game-text);
  border-radius: var(--game-border-radius);
  box-shadow: var(--game-shadow);
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: fadeIn 0.3s;
}

.game-credits-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--game-accent);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}
.game-credits-close:hover {
  color: var(--game-btn-bg-hover);
}

.game-credits-title {
  margin: 0 0 1rem 0;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
}

.game-credits-content {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 900px) {
  .iso-game-container,
  #game-container {
    max-width: 100%;
    margin: 20px auto;
  }
}

@media (max-width: 600px) {
  .iso-game-container,
  #game-container {
    margin: 10px auto;
  }
  
  .game-start-title {
    font-size: 2rem;
  }
  
  .game-menu-item {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
  }
  
  .game-dialog {
    padding: 1rem 1.5rem;
  }
  
  .game-credits-modal {
    padding: 1.5rem;
  }
  
  .game-credits-title {
    font-size: 1.5rem;
  }
  
  .game-credits-content {
    font-size: 0.9rem;
  }
}

/* Overlay: Settings */
.game-settings-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(34, 45, 56, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  transition: opacity 0.3s ease;
}

.game-settings-modal {
  background: var(--game-dialog-bg);
  color: var(--game-text);
  border-radius: var(--game-border-radius);
  box-shadow: var(--game-shadow);
  padding: 2.5rem 3rem 2rem 3rem;
  min-width: 360px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--game-accent) transparent;
}

.game-settings-modal::-webkit-scrollbar {
  width: 8px;
}

.game-settings-modal::-webkit-scrollbar-track {
  background: transparent;
}

.game-settings-modal::-webkit-scrollbar-thumb {
  background-color: var(--game-accent);
  border-radius: 4px;
}

.game-settings-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--game-accent);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.game-settings-close:hover {
  color: var(--game-btn-bg-hover);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.game-settings-title {
  margin: 0 0 2rem 0;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: var(--game-text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-settings-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
}

.game-settings-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-settings-field:last-child {
  border-bottom: none;
}

.game-settings-field label {
  flex: 1 1 60%;
  font-size: 1.1rem;
  color: var(--game-text);
  opacity: 0.9;
}

.game-settings-field input[type="number"],
.game-settings-field input[type="range"] {
  flex: 1 1 40%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--game-btn-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--game-text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.game-settings-field input[type="number"]:focus,
.game-settings-field input[type="range"]:focus {
  outline: none;
  border-color: var(--game-accent);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.game-settings-field input[type="number"] {
  width: 100px;
  text-align: center;
}

.game-settings-field input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  padding: 0;
}

.game-settings-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--game-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-settings-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--game-btn-bg-hover);
}

.game-settings-field input[type="checkbox"] {
  position: relative;
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-settings-field input[type="checkbox"]:checked {
  background: var(--game-accent);
}

.game-settings-field input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-settings-field input[type="checkbox"]:checked::before {
  left: 22px;
}

.game-settings-field span {
  min-width: 3rem;
  text-align: right;
  color: var(--game-accent);
  font-size: 1rem;
  font-weight: 500;
}

.game-settings-apply,
.game-settings-reset {
  margin-top: 2rem;
  background: var(--game-btn-bg);
  color: var(--game-btn-text);
  border: none;
  border-radius: var(--game-btn-radius);
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--game-btn-shadow);
  transition: all 0.2s ease;
  align-self: center;
}

.game-settings-apply:hover,
.game-settings-reset:hover {
  background: var(--game-btn-bg-hover);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-settings-reset {
  background: transparent;
  border: 1px solid var(--game-accent);
  color: var(--game-accent);
  margin-top: 1rem;
}

.game-settings-reset:hover {
  background: rgba(79, 195, 247, 0.1);
}

@media (max-width: 600px) {
  .game-settings-modal {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    min-width: 280px;
    max-width: 95vw;
  }

  .game-settings-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .game-settings-form {
    gap: 1rem;
  }

  .game-settings-field {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .game-settings-field label {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .game-settings-field input[type="number"],
  .game-settings-field input[type="range"] {
    width: 100%;
  }

  .game-settings-field span {
    text-align: left;
    margin-top: 0.25rem;
  }

  .game-settings-apply,
  .game-settings-reset {
    width: 100%;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
  }
}

.game-start-button,
.game-settings-button,
.game-credits-button,
.game-continue-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  color: var(--game-text, #fff);
  background: var(--game-accent, #4fc3f7);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
  margin-bottom: 0.5rem;
}

.game-start-button:hover,
.game-settings-button:hover,
.game-credits-button:hover,
.game-continue-button:hover {
  background: var(--game-accent-hover, #0288d1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-start-button:active,
.game-settings-button:active,
.game-credits-button:active,
.game-continue-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* =============================
   Content System - FAB & Overlay
   ============================= */

/* Content FAB (Floating Action Button) */
.content-fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.content-fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--game-accent, #4fc3f7);
  border: none;
  color: var(--game-text, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.content-fab-button:hover {
  background: var(--game-btn-bg-hover, #0288d1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.content-fab-button:active {
  transform: scale(0.95);
}

.content-fab-button.has-new-content {
  animation: pulse-fab 2s infinite;
}

@keyframes pulse-fab {
  0%, 100% { 
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(79, 195, 247, 0.7);
  }
  50% { 
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(79, 195, 247, 0);
  }
}

/* Content FAB Indicator */
.content-fab-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #ff5722;
  border-radius: 50%;
  border: 2px solid var(--game-bg, #2e3b47);
  animation: bounce-indicator 1s infinite alternate;
}

@keyframes bounce-indicator {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

/* Content Overlay */
.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.content-overlay-modal {
  width: 100%;
  max-width: 800px;
  height: 70%;
  background: var(--game-dialog-bg, rgba(30, 36, 44, 0.97));
  border-radius: var(--game-border-radius, 14px) var(--game-border-radius, 14px) 0 0;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.content-overlay-modal.slide-up {
  transform: translateY(0);
}

/* Content Overlay Header */
.content-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-overlay-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--game-text, #fff);
}

.content-overlay-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--game-text, #fff);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.content-overlay-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* Content Overlay Tabs */
.content-overlay-tabs {
  display: flex;
  padding: 0 2rem;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-overlay-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: all 0.2s;
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
}

.content-overlay-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--game-text, #fff);
}

.content-overlay-tab.active {
  background: rgba(79, 195, 247, 0.15);
  color: var(--game-accent, #4fc3f7);
  border-bottom: 2px solid var(--game-accent, #4fc3f7);
}

.content-overlay-tab.has-new-content::after {
  content: '';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  background: #ff5722;
  border-radius: 50%;
}

/* Content Overlay Content Area */
.content-overlay-content {
  flex: 1;
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
}

.content-overlay-content::-webkit-scrollbar {
  width: 8px;
}

.content-overlay-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.content-overlay-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.content-overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Empty States */
.content-overlay-empty,
.content-overlay-no-tabs {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
}

/* Content Items */
.content-overlay-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.content-overlay-item:last-child {
  margin-bottom: 0;
}

.content-overlay-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.content-overlay-item--new {
  border-left-color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
}

.content-overlay-item--in-progress {
  border-left-color: var(--game-accent, #4fc3f7);
  background: rgba(79, 195, 247, 0.1);
}

.content-overlay-item--completed {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}

.content-overlay-item--discovered {
  border-left-color: #9c27b0;
  background: rgba(156, 39, 176, 0.1);
}

/* Content Item Header */
.content-overlay-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.content-overlay-item-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--game-text, #fff);
}

.content-overlay-item-status {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.content-overlay-item-status--new {
  background: #ff9800;
  color: #fff;
}

.content-overlay-item-status--in-progress {
  background: var(--game-accent, #4fc3f7);
  color: #fff;
}

.content-overlay-item-status--completed {
  background: #4caf50;
  color: #fff;
}

.content-overlay-item-status--discovered {
  background: #9c27b0;
  color: #fff;
}

/* Content Item Body */
.content-overlay-item-description {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.content-overlay-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.content-overlay-item-category {
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.content-overlay-item-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(79, 195, 247, 0.2);
  color: var(--game-accent, #4fc3f7);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .content-fab {
    bottom: 16px;
    right: 16px;
  }
  
  .content-fab-button {
    width: 48px;
    height: 48px;
  }
  
  .content-overlay-modal {
    height: 85%;
  }
  
  .content-overlay-header,
  .content-overlay-tabs,
  .content-overlay-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .content-overlay-item {
    padding: 1rem;
  }
  
  .content-overlay-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}