:root {
  color-scheme: light;
  --ink: #15313a;
  --muted: #5e7377;
  --paper: #f7f4ee;
  --panel: #ffffff;
  --sea: #165a72;
  --sea-dark: #0f4051;
  --sun: #f0b949;
  --leaf: #2f7a55;
  --line: rgba(21, 49, 58, 0.14);
  --shadow: 0 18px 50px rgba(21, 49, 58, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

/* Main Menu */
.main-menu {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--sea-dark);
  z-index: 1000;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.main-menu.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.menu-art {
  position: absolute;
  inset: 0;
  background-image: url("assets/hotel-room-progression.png");
  background-position: right center;
  background-size: cover;
  filter: saturate(1.08) contrast(1.05);
}

.menu-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 32, 41, 0.86), rgba(7, 32, 41, 0.48), rgba(7, 32, 41, 0.22)),
    linear-gradient(0deg, rgba(7, 32, 41, 0.34), rgba(7, 32, 41, 0));
}

.menu-content {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  margin-right: auto;
  padding: clamp(24px, 7vw, 72px);
  color: white;
}

.menu-kicker {
  margin: 0 0 12px;
  color: #f6d27a;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.menu-content h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.9;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.menu-actions button {
  min-width: 178px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--sun);
  color: var(--ink);
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.menu-actions button:first-child {
  background: white;
  color: var(--sea-dark);
}

#howToButton {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: white;
}

.menu-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.menu-save-hint {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.menu-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 800;
}

/* App Shell */
.app-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

/* Left Side: Resort Stage */
.resort-stage {
  flex: 1;
  height: 100%;
  background: #cbe8e3;
  position: relative;
  overflow: hidden;
}

.room-art {
  position: absolute;
  inset: 0;
  background-image: url("assets/hotel-room-progression.png");
  background-position: left center;
  background-size: 300% 100%;
  filter: saturate(1.04);
  transition: background-position 420ms ease, filter 420ms ease;
}

.room-art[data-stage="upgraded"] { background-position: center center; }
.room-art[data-stage="luxury"] { background-position: right center; }

.floating-stats {
  position: absolute;
  left: 32px;
  bottom: 32px;
  display: flex;
  gap: 12px;
}

.floating-stats span {
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--sea-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Right Side: Control Panel */
.control-panel {
  width: 400px;
  height: 100%;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 2px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

/* Sections inside Control Panel */
.control-panel > section,
.control-panel > header,
.control-panel > div {
  flex-shrink: 0;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: block;
}

.control-panel > header {
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 200;
}

/* Typography & Brand */
.brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.cash-balance {
  background: var(--sea);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 1.2rem;
}

/* Metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-grid article {
  text-align: center;
}

.metric-grid span {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
}

/* Section Heading */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-heading span {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

/* Cards & Lists */
.rooms-list, .amenities-list, .characters-list, .luxury-list, .milestones-list, .reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: auto !important;
  min-height: min-content !important;
}

.room-card, .amenity-card, .character-card, .luxury-card, .milestone-card, .review-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: block;
  position: relative;
}

/* Unavailable Items */
.is-unavailable {
  opacity: 0.5 !important;
  filter: grayscale(90%) !important;
}

/* Premium Items Highlight */
.is-premium {
  border: 3px solid var(--sun) !important;
  background: linear-gradient(135deg, #fffcf0, white) !important;
  box-shadow: 0 8px 24px rgba(240, 185, 73, 0.25) !important;
}

.is-premium h2 {
  color: #b8860b !important;
  font-weight: 900 !important;
}

.is-premium.is-clickable {
  cursor: pointer;
}

.is-premium.is-clickable:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 12px 32px rgba(240, 185, 73, 0.4) !important;
}

.room-card-main, .milestone-copy {
  display: flex;
  justify-content: space-between;
}

.room-card h2, .character-info h2, .amenity-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.room-card p, .character-card p, .amenity-card p, .milestone-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.room-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.room-stats span {
  background: var(--paper);
  padding: 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  text-align: center;
  font-weight: 700;
}

/* Buttons */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

#checkInButton, .ad-button, .room-actions button, .character-card button, .amenity-card button {
  min-height: 48px;
  background: var(--sea);
  color: white;
}

#checkInButton { background: var(--sun); color: var(--ink); }

.room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* Specialist / Character Specifics */
.character-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.character-visual {
  flex: 0 0 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.character-visual[data-character="bellboy"] { background-color: #e74c3c; }
.character-visual[data-character="bartender"] { background-color: #3498db; }
.character-visual[data-character="concierge"] { background-color: #2ecc71; }
.character-visual[data-character="butler"] { background-color: #9b59b6; }
.character-visual[data-character="manager"] { background-color: #f1c40f; }

/* Ratings Card */
.resort-rating-card {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--sun);
}

.rating-stars {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

.rating-stars .star { color: rgba(0,0,0,0.1); font-size: 1.5rem; }
.rating-stars .star.active { color: var(--sun); }

.rating-progress-track {
  height: 6px;
  background: var(--paper);
  border-radius: 3px;
}

.rating-progress-fill {
  height: 100%;
  background: var(--sea);
  border-radius: 3px;
  transition: width 0.5s;
}

/* Offline Notice */
.offline-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 500;
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 840px) {
  .app-shell {
    flex-direction: column;
  }

  .resort-stage {
    height: 40%;
    width: 100%;
    flex: none;
  }

  .control-panel {
    width: 100%;
    height: 60%;
    flex: none;
    border-left: 0;
    border-top: 2px solid var(--line);
  }

  .room-actions {
    grid-template-columns: 1fr;
  }
}
