/* Modern Obsidian-Emerald Tavern Design System */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Outfit:wght@300;400;500;700&display=swap');

:root {
  --bg-primary: #040a07;
  --bg-gradient: linear-gradient(135deg, #0b1f16 0%, #030806 100%);
  --bg-image: url('/images/tavern_background.png');
  --color-emerald-glow: #10b981;
  --color-emerald-dark: #064e3b;
  --color-emerald-light: #34d399;
  --color-emerald-muted: rgba(16, 185, 129, 0.15);
  --color-gold: #fbbf24;
  --color-gold-glow: rgba(251, 191, 36, 0.4);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-heading: 'Cinzel', serif;
  --font-body: 'Outfit', sans-serif;
  
  --glass-bg: rgba(7, 18, 13, 0.85);
  --glass-border: 1px solid rgba(16, 185, 129, 0.2);
  --glass-border-hover: 1px solid rgba(52, 211, 153, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: var(--bg-primary);
  background-image: linear-gradient(rgba(4, 10, 7, 0.82), rgba(4, 10, 7, 0.9)), var(--bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--color-emerald-dark);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-emerald-glow);
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 50px;
}

h1.tavern-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
  margin-bottom: 10px;
}

h1.tavern-title span {
  color: var(--color-emerald-light);
}

.tavern-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-style: italic;
  letter-spacing: 1px;
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 30px;
}

.glass-card:hover {
  border: var(--glass-border-hover);
  box-shadow: var(--glass-shadow), var(--glow-shadow);
}

/* Game Selection Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.game-card {
  display: flex;
  flex-direction: column;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass-bg);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  text-decoration: none;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-8px);
  border: var(--glass-border-hover);
  box-shadow: var(--glass-shadow), var(--glow-shadow), 0 0 25px rgba(16, 185, 129, 0.2);
}

.game-image-container {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.game-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card:hover .game-image-container img {
  transform: scale(1.05);
}

.game-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.game-card:hover .game-name {
  color: var(--color-emerald-light);
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.game-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.game-action {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-emerald-light);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

/* Game page header */
.game-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.game-header-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--color-emerald-glow);
  box-shadow: var(--glow-shadow);
}

.game-header-info h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-primary);
}

.game-header-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

input.input-text {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.05rem;
  background: rgba(10, 25, 18, 0.6);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
}

input.input-text:focus {
  outline: none;
  border-color: var(--color-emerald-light);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25), inset 0 2px 4px rgba(0,0,0,0.5);
  background: rgba(10, 25, 18, 0.85);
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.btn-emerald {
  background: var(--color-emerald-glow);
  color: #030806;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-emerald:hover {
  background: var(--color-emerald-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.6);
}

.btn-emerald:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.actions-row {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

/* Answer styles */
.parchment-container {
  background: linear-gradient(to bottom, #11281e 0%, #081610 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  padding: 35px;
  position: relative;
  overflow: hidden;
}

.parchment-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-emerald-light), transparent);
}

.answer-header {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-gold);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-box {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--color-emerald-glow);
  padding: 15px 20px;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 8px 8px 0;
  margin-bottom: 25px;
}

.answer-body {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap; /* Preserve formatting and paragraphs */
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 8, 6, 0.9);
  backdrop-filter: blur(5px);
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--color-emerald-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--color-emerald-light);
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.loading-subtext {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 350px;
  line-height: 1.4;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility layout styles */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}
