/* Fernwhisper "Redwall" theme */
:root {
  --mv-ink: #2b221a;
  --mv-ink-muted: #5b4a39;
  --mv-parchment: #f3ecd7;
  --mv-parchment-2: #efe5c9;
  --mv-deep: #1f1b16;
  --mv-gold: #b0893b;
  --mv-moss: #2f5d3a;
  --mv-russet: #743a2d;
  --mv-stone: #6b5f52;
}

html, body {
  height: 100%;
}

body {
  color: var(--mv-ink);
  background: radial-gradient(1200px 800px at 10% 10%, rgba(176, 143, 97, 0.08), transparent 70%),
              radial-gradient(900px 600px at 90% 20%, rgba(110, 86, 60, 0.06), transparent 60%),
              linear-gradient(180deg, var(--mv-parchment), var(--mv-parchment-2));
  background-attachment: fixed;
  font-family: 'EB Garamond', Georgia, serif;
}

/* Help iOS respect author sizes and avoid unintended auto-zoom */
html { -webkit-text-size-adjust: 100%; }

/* Header bar */
.mv-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.25));
  border-bottom: 2px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 0 rgba(0,0,0,0.04);
}

.mv-title {
  font-family: 'IM Fell English', 'EB Garamond', Georgia, serif;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

/* Card / panel */
.mv-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.6));
  border: 1px solid rgba(43,34,26,0.15);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31,27,22,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
}

.mv-panel {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(43,34,26,0.12);
  border-radius: 8px;
}

.mv-border {
  border-color: rgba(43,34,26,0.2) !important;
}

.mv-muted { color: var(--mv-ink-muted); }

/* Buttons */
.mv-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #fff;
  background: linear-gradient(180deg, var(--mv-moss), #24492d);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 0 rgba(0,0,0,0.08);
  text-transform: none;
}

.mv-button:hover { filter: brightness(1.05); }
.mv-button:active { transform: translateY(1px); }

.mv-button--secondary {
  background: linear-gradient(180deg, var(--mv-russet), #5c2e24);
}

/* Brand buttons */
.mv-button--facebook {
  background: #1877F2;
  color: #fff;
}
.mv-button__icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.mv-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  color: var(--mv-ink);
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.5));
  border: 1px solid rgba(43,34,26,0.18);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.mv-choice:hover { background: rgba(255,255,255,0.75); }

/* Story text */
.mv-prose { font-size: 1.4rem; }
.mv-prose p { margin: 0 0 0.85rem 0; line-height: 1.7; }
.mv-ornament { color: var(--mv-gold); }

/* Game grid theming overrides */
.mv-tile {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; border-radius: 4px;
}
.mv-tile--pending {
  background: rgba(43,34,26,0.08);
  border: 1px dashed rgba(43,34,26,0.3);
  color: var(--mv-deep);
}
.mv-tile--correct { background: #236345; }
.mv-tile--present { background: #b07d21; }
.mv-tile--absent  { background: #6b6258; }

/* Keyboard keys */
.mv-key { background: #d8cfbf; color: var(--mv-deep); border-radius: 6px; }
.mv-key--good { background: #2c7b56b1; }
.mv-key--warn { background: #d39727; }
.mv-key--bad  { background: #6b6258a3; }

/* Prevent double-tap zoom on interactive elements (iOS Safari) */
.mv-key, .mv-button, button { touch-action: manipulation; }

/* Utility */
.mv-container { max-width: 64rem; margin: 0 auto; padding: 1rem; }

/* Landing helpers */
.mv-crest { width: 64px; height: 64px; }
.mv-logo { width: 44px; height: auto; display: block; }
.mv-aspect-16-9 { position: relative; padding-top: 56.25%; }
.mv-aspect-fill { position: absolute; inset: 0; }
.mv-screenshot {
  background: repeating-linear-gradient(135deg, rgba(176,137,59,0.15) 0, rgba(176,137,59,0.15) 8px, rgba(243,236,215,0.35) 8px, rgba(243,236,215,0.35) 16px);
  border: 2px dashed rgba(43,34,26,0.25);
  display: flex; align-items: center; justify-content: center;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .mv-container { padding: 0.75rem; }
  .mv-logo { width: 36px; }
  .mv-title { line-height: 1.1; }
  /* Make mobile menu buttons full-width for easy tapping */
  .mv-panel .mv-button { width: 100%; justify-content: center; }
}

/* Stop iOS from zooming inputs on focus by ensuring 16px+ font */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}

/* Plain link utility */
.mv-link-plain {
  color: inherit;
  text-decoration: none;
}
.mv-link-plain:hover, .mv-link-plain:focus {
  color: inherit;
  text-decoration: none;
}

/* Google Sign-In button (material) */
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: white;
  background-image: none;
  border: 1px solid #747775;
  border-radius: 4px;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
  display: inline-flex;
}
.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}
.gsi-material-button .gsi-material-button-content-wrapper {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}
.gsi-material-button .gsi-material-button-contents {
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
.gsi-material-button .gsi-material-button-state {
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
  border-color: #1f1f1f1f;
}
.gsi-material-button:disabled .gsi-material-button-contents { opacity: 38%; }
.gsi-material-button:disabled .gsi-material-button-icon { opacity: 38%; }
.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 12%;
}
.gsi-material-button:not(:disabled):hover {
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}
.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 8%;
}
