:root {
  --bg-dark: #1e1410;
  --bg-mid: #2c1d14;
  --accent: #d9a441;
  --app-height: 100vh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, var(--bg-mid), var(--bg-dark));
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: #fff;
}

#game-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height);
  min-height: var(--app-height);
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#game-container canvas {
  display: block;
  margin: auto;
  max-width: 100%;
  max-height: var(--app-height);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}

#game-container.lc-feedback-open canvas {
  pointer-events: none;
}

#lc-feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: auto;
}

.lc-feedback-panel {
  width: min(460px, 100%);
  padding: 24px 22px 20px;
  border: 3px solid var(--accent);
  border-radius: 16px;
  background: rgba(44, 29, 20, 0.98);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.lc-feedback-title {
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 700;
  color: #f3e3c3;
  text-align: center;
}

.lc-feedback-subtitle {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: #c9b08a;
  text-align: center;
}

.lc-feedback-privacy {
  margin-bottom: 18px;
  font-size: 12px;
  line-height: 1.4;
  color: #a89274;
  text-align: center;
}

.lc-feedback-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #d9a441;
}

.lc-feedback-select,
.lc-feedback-input,
.lc-feedback-textarea {
  width: 100%;
  margin-bottom: 14px;
  border: 2px solid #8a5a2b;
  border-radius: 10px;
  background: #1e1410;
  color: #f3e3c3;
  font: 15px "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  outline: none;
}

.lc-feedback-select,
.lc-feedback-input {
  height: 38px;
  padding: 0 12px;
}

.lc-feedback-textarea {
  padding: 10px 12px;
  resize: vertical;
  min-height: 110px;
}

.lc-feedback-select:focus,
.lc-feedback-input:focus,
.lc-feedback-textarea:focus {
  border-color: var(--accent);
}

.lc-feedback-honeypot {
  display: none;
}

.lc-feedback-status {
  min-height: 20px;
  margin-bottom: 12px;
  font-size: 14px;
  text-align: center;
  color: #c9b08a;
}

.lc-feedback-status[data-kind="error"] {
  color: #e88a89;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.lc-feedback-status[data-kind="success"] {
  color: #7fd68a;
}

.lc-feedback-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.lc-feedback-btn {
  min-width: 130px;
  height: 42px;
  border: none;
  border-radius: 10px;
  font: 700 16px "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.lc-feedback-cancel {
  background: #8a5a2b;
  color: #f3e3c3;
}

.lc-feedback-submit {
  background: var(--accent);
  color: #2c1d14;
}

.lc-feedback-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lc-feedback-captcha {
  margin-bottom: 12px;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  color: #9a8570;
}

.lc-feedback-captcha a {
  color: var(--accent);
  text-decoration: underline;
}

body.lc-recaptcha-active .grecaptcha-badge {
  z-index: 40 !important;
  visibility: visible !important;
}

.books-toolbar {
  position: absolute;
  z-index: 20;
  display: flex;
  gap: 12px;
  align-items: center;
  box-sizing: border-box;
}

.books-toolbar-field {
  display: block;
  min-width: 0;
  margin: 0;
}

.books-toolbar-field--category {
  flex: 0 0 220px;
}

.books-toolbar-field--search {
  flex: 1 1 auto;
}

.books-field {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 2px solid #d9a441;
  border-radius: 10px;
  background: #2c1d14;
  color: #f3e3c3;
  font: bold 15px "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  outline: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.books-field:focus {
  border-color: #f0c96a;
}

select.books-field {
  cursor: pointer;
}

@media (max-width: 640px) {
  .books-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .books-toolbar-field--category {
    flex-basis: auto;
  }
}

body.book-detail-page {
  overflow: auto;
}

.book-detail-root {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 20px 48px;
  display: flex;
  justify-content: center;
}

.book-detail-loading,
.book-detail-card {
  width: min(720px, 100%);
  padding: 28px 28px 32px;
  border: 3px solid var(--accent);
  border-radius: 16px;
  background: rgba(44, 29, 20, 0.98);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  color: #f3e3c3;
}

.book-detail-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.book-detail-spine {
  flex: 0 0 18px;
  align-self: stretch;
  min-height: 88px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.book-detail-kicker {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d9a441;
}

.book-detail-header h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  line-height: 1.25;
}

.book-detail-meta {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.book-detail-full-title {
  margin: 0 0 20px;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  line-height: 1.35;
  color: #f3e3c3;
  font-weight: 700;
}

.book-detail-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

.book-detail-row dt {
  font-weight: 700;
  color: #d9a441;
}

.book-detail-row dd,
.book-detail-muted {
  color: #c9b08a;
  line-height: 1.5;
}

.book-detail-description h2 {
  margin: 0;
  font-size: 1rem;
  color: #d9a441;
}

.book-detail-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.book-detail-translate-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 2px solid #d9a441;
  border-radius: 10px;
  background: #8a5a2b;
  color: #f3e3c3;
  font: bold 13px "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.book-detail-translate-btn:hover:not(:disabled) {
  background: #d9a441;
  color: #2c1d14;
}

.book-detail-translate-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.book-detail-description p {
  color: #c9b08a;
  line-height: 1.65;
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .book-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
