/* styles.css */
/* Last updated: 2026-02-11 */

:root {
  --c-text: #313131;
  --c-gray: #656565;
  --c-light: #999;
  --c-bg: #f7f7f7;
  --c-bg-hover: #e8e8e8;
  --c-border: #ccc;
  --radius: 3px;
  --dice-shadow: drop-shadow(1px 0 0 var(--c-gray)) 
                 drop-shadow(-1px 0 0 var(--c-gray)) 
                 drop-shadow(0 1px 0 var(--c-gray)) 
                 drop-shadow(0 -1px 0 var(--c-gray)) 
                 drop-shadow(0 2px 2px rgba(0,0,0,.18));
}

* { box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 11px;
  color: var(--c-text);
}

h2 {
  font-size: 1.3em;
  margin: 0.73em 0;
  font-weight: bold;
}

.text-gray, .label, .footer, .dice-rolls-detail { color: var(--c-gray); }
.text-small, .footer { font-size: 0.9em; }
.label { font-size: 0.85em; margin-right: 5px; }
.empty-state, .mode-selector { color: var(--c-light); }
.help-cursor { cursor: help; }

.flex-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}

.input-wide { width: 325px; max-width: 100%; }
.result-container { margin-top: 10px; }
.result-label { font-weight: bold; margin-right: 8px; }

input[type="date"] {
  padding: 4px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.95em;
}

.date-input-group { margin-bottom: 10px; }
.date-input-group label { display: inline-block; font-size: 0.95em; margin-right: 8px; }
.mode-selector input[type="radio"] { margin: 0 2px 0 10px; }

.ctrl-btn {
  background: #fff;
  border: 1px solid var(--c-border);
  border-bottom-color: #aaa;
  padding: 4px 10px;
  margin: 0 2px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

.dice-btn, .ctrl-btn {
  font-family: inherit;
}

.ctrl-btn:hover { background: var(--c-bg-hover); border-color: #999; }
.ctrl-btn:active { transform: translateY(1px); box-shadow: none; border-bottom-color: var(--c-border); }
.ctrl-btn.active {
  background: var(--c-text);
  color: white;
  border-color: var(--c-text);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.dice-wrap {
  display: inline-block;
  filter: var(--dice-shadow);
}

.dice-btn {
  background: var(--c-bg);
  border: none;
  cursor: pointer;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background-color .15s;
  width: 50px;
  height: 50px;
}

.dice-btn:hover { background: var(--c-bg-hover); }

.d4 { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.d6 { border-radius: 4px; width: 44px; height: 44px; }
.d8 { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.d10 { clip-path: polygon(50% 0%, 100% 30%, 80% 100%, 20% 100%, 0% 30%); }
.d12 { clip-path: polygon(50% 0%, 100% 38%, 81% 100%, 19% 100%, 0% 38%); }
.d20 { clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.d100 { clip-path: none; border-radius: 50%; width: 54px; height: 54px; }

.hist-table {
  border-collapse: collapse;
  font-size: 0.75em;
  line-height: 1;
}

.hist-row td { padding: 1px 0; text-align: right; }
.hist-bar-cell { width: 120px; position: relative; padding: 2px 0; }

.bar {
  height: 10px;
  background: #ddd;
  border-radius: 2px;
  width: 100%;
}

.bar.fixed { width: 150px; height: 8px; }

.bar-fill {
  height: 100%;
  background: var(--c-text);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.hist-avg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #fff;
  mix-blend-mode: exclusion;
}

.hist-meta, .progress-label { 
  margin-top: 3px; 
  font-size: 0.85em;
   color: #555;
}

.progress-label { margin-bottom: 2px; margin-top: 0; }

.progress-wrap { margin: 10px 0; font-size: 0.85em; }
.progress-item { margin-bottom: 6px; }
.algo-value { color: var(--c-text); font-weight: bold; }

.history-box {
  max-height: 150px;
  overflow-y: auto;
  padding: 8px;
  background: #f5f5f5;
  border-radius: var(--radius);
  font-size: 0.85em;
  margin-top: 5px;
}
