/* GTD Dice Roller - styles.css v13 */
:root {
  --primary: #d4820a;
  --primary-dark: #b36d08;
  --secondary: #5a7a2e;
  --bg: #1a1208;
  --surface: rgba(30, 22, 8, 0.92);
  --surface2: rgba(45, 33, 10, 0.95);
  --border: rgba(180, 130, 30, 0.35);
  --text: #e8d9b0;
  --text-muted: #a09070;
  --highlight: #d4820a;
  --radius: 6px;
  --shadow: 0 4px 20px rgba(0,0,0,0.7);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  background-image: url('../images/Dice Roller Background Rev1.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
header {
  background: rgba(15, 10, 2, 0.93);
  border-bottom: 2px solid var(--primary);
  padding: 12px 20px;
  backdrop-filter: blur(8px);
}
.header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-logo img {
  height: 62px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 6px rgba(212,130,10,0.5));
}
header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* ===== LAYOUT ===== */
main { flex: 1; padding: 24px 16px; }
.container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== DICE PANEL ===== */
.dice-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.dice-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  min-height: 110px;
  align-items: center;
}

/* ===== DIE ===== */
.die {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  cursor: default;
  transition: transform 0.15s ease;
  gap: 2px;
}
.die:hover { transform: translateY(-2px); }
.die-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.die-type-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.85;
  text-transform: uppercase;
}

@keyframes roll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-8deg) scale(1.05); }
  50% { transform: rotate(8deg) scale(1.1); }
  75% { transform: rotate(-4deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}
.die.rolling { animation: roll 0.35s ease; }

/* ===== CONTROLS ===== */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
}
.btn-primary {
  background: linear-gradient(180deg, #e08c10 0%, #b36d08 100%);
  color: #fff;
  border: 1px solid #c07808;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #eda020 0%, #c87a0a 100%);
  box-shadow: 0 4px 12px rgba(212,130,10,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: linear-gradient(180deg, #4a5c28 0%, #354218 100%);
  color: var(--text);
  border: 1px solid #5a6e30;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, #5a6e30 0%, #445220 100%);
  transform: translateY(-1px);
}
.btn-large { padding: 12px 36px; font-size: 1rem; }

.btn-clear-history {
  background: rgba(120, 20, 20, 0.5);
  color: rgba(255, 140, 140, 0.95);
  border: 1px solid rgba(160, 40, 40, 0.5);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 10px;
  display: block;
  width: 100%;
  font-family: 'Inter', sans-serif;
}
.btn-clear-history:hover {
  background: rgba(160, 30, 30, 0.7);
  border-color: rgba(220, 60, 60, 0.7);
}

/* ===== TOTAL DISPLAY ===== */
.total-display {
  text-align: center;
  padding: 10px 20px;
  margin-top: 4px;
}
.total-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 8px;
}
.total-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ===== RECENT ROLLS ===== */
.recent-rolls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.recent-rolls-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 10px 0;
  font-weight: 600;
}
.rolls-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}
.roll-entry {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-family: monospace;
}
.roll-entry:last-child { border-bottom: none; }

/* ===== CHANGE DICE PANEL ===== */
.change-dice-panel {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.change-dice-panel.active { display: block; }
.panel-header {
  background: rgba(20, 14, 4, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.close-btn:hover { color: var(--primary); }
.panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.config-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.config-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Count & Type Buttons */
.dice-count-selector, .dice-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.count-btn, .type-btn {
  padding: 6px 14px;
  background: rgba(40, 30, 8, 0.9);
  border: 1px solid rgba(180,130,30,0.3);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.count-btn:hover, .type-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}
.count-btn.active, .type-btn.active {
  background: linear-gradient(180deg, #e08c10 0%, #b36d08 100%);
  border-color: #c07808;
  color: #fff;
  box-shadow: 0 2px 6px rgba(212,130,10,0.35);
}

/* Color Pickers */
.color-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.color-picker-group input[type="color"] {
  width: 40px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: none;
  padding: 1px;
}

/* Panel Footer */
.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ===== FOOTER ===== */
.site-footer {
  background: rgba(15, 10, 2, 0.85);
  border-top: 1px solid var(--primary);
  padding: 14px 20px;
  text-align: center;
  margin-top: auto;
}
.copyright {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .die { width: 72px; height: 72px; }
  .die-value { font-size: 1.7rem; }
  header h1 { font-size: 1.2rem; }
  .btn-large { padding: 10px 24px; }
}