/* ═══════════════════════════════════════════════════════════
   DICE-ROLLER.CSS — Premium Design System
   The Wheel of Name — Dice Roller Tool
═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────── */
:root {
    --dr-brand:       #E85D04;
    --dr-brand-2:     #C94E03;
    --dr-brand-light: #FF8C42;
    --dr-accent:      #7C3AED;
    --dr-surface:     #FFFFFF;
    --dr-surface-2:   #F9FAFB;
    --dr-border:      #E5E7EB;
    --dr-text:        #111827;
    --dr-muted:       #6B7280;
    --dr-shadow-xs:   0 1px 4px rgba(0,0,0,0.07);
    --dr-shadow-sm:   0 4px 14px rgba(0,0,0,0.08);
    --dr-shadow-md:   0 8px 32px rgba(0,0,0,0.10);
    --dr-shadow-lg:   0 20px 60px rgba(0,0,0,0.14);
    --dr-radius-sm:   10px;
    --dr-radius:      16px;
    --dr-radius-lg:   24px;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.dr-breadcrumb-wrap {
    padding: 0.6rem 0;
    background: var(--dr-surface-2);
    border-bottom: 1px solid var(--dr-border);
}
.dr-breadcrumb-wrap .dr-wrap { display: flex; }
.dr-breadcrumb-wrap .breadcrumb { margin: 0; font-size: 0.81rem; }
.dr-breadcrumb-wrap .breadcrumb-item a { color: var(--dr-brand); text-decoration: none; }
.dr-breadcrumb-wrap .breadcrumb-item a:hover { text-decoration: underline; }

/* ── Hero ───────────────────────────────────────────────── */
.dr-hero {
    background: linear-gradient(135deg, #0F0C1A 0%, #1C1040 55%, #2A0E1A 100%);
    padding: 3rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}

.dr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 55% at 50% -5%,
        rgba(232,93,4,0.20) 0%, transparent 65%);
    pointer-events: none;
}

.dr-hero::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%, #E85D04 30%, #7C3AED 70%, transparent 100%);
}

.dr-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    position: relative;
}

/* ── Hero Copy ──────────────────────────────────────────── */
.dr-hero-copy { color: #fff; }

.dr-eyebrow {
    display: inline-block;
    background: rgba(232,93,4,0.18);
    border: 1px solid rgba(232,93,4,0.35);
    border-radius: 99px;
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #FF8C42;
    margin-bottom: 1.1rem;
}

.dr-hero-copy h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.55rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.dr-hero-copy h1 span {
    background: linear-gradient(90deg, #FF8C42, #E85D04);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dr-hero-lead {
    color: rgba(255,255,255,0.62);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.dr-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dr-trust-badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    backdrop-filter: blur(6px);
}

/* ── Hero Dice Panel ────────────────────────────────────── */
.dr-dice-panel {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: var(--dr-radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.dr-controls-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.dr-ctrl-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dr-ctrl-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.65);
    width: 88px;
    flex-shrink: 0;
}

.dr-select {
    flex: 1;
    height: 40px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: var(--dr-radius-sm);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 32px 0 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.55)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.dr-select:focus {
    outline: 2px solid rgba(232,93,4,0.65);
    outline-offset: 2px;
    border-color: rgba(232,93,4,0.5);
}

.dr-select option { background: #1c1040; color: #fff; }

.dr-btn-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.15rem;
}

.btn-roll {
    flex: 1;
    height: 48px;
    background: linear-gradient(135deg, #E85D04, #FF6B35);
    color: #fff;
    border: none;
    border-radius: var(--dr-radius-sm);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 20px rgba(232,93,4,0.50);
    letter-spacing: 0.02em;
}

.btn-roll:hover  { transform: translateY(-2px); box-shadow: 0 6px 26px rgba(232,93,4,0.60); }
.btn-roll:active { transform: translateY(0); }
.btn-roll:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.btn-clr-sm {
    height: 48px;
    padding: 0 14px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--dr-radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-clr-sm:hover { background: rgba(255,255,255,0.15); }

/* ── Dice Display Grid ──────────────────────────────────── */
.dr-dice-display {
    min-height: 96px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255,255,255,0.10);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 1rem;
}

.dr-dice-placeholder {
    color: rgba(255,255,255,0.32);
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
}

/* Single die */
.dr-die {
    width: 76px; height: 76px;
    perspective: 600px;
    display: flex; align-items: center; justify-content: center;
}

.dr-die-inner {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    font-size: 1.85rem;
}

@keyframes drSpin {
    0%   { transform: rotateX(0deg) rotateY(0deg); }
    30%  { transform: rotateX(210deg) rotateY(130deg); }
    65%  { transform: rotateX(420deg) rotateY(300deg); }
    100% { transform: rotateX(720deg) rotateY(720deg); }
}

.dr-die-inner.spin {
    animation: drSpin 0.7s cubic-bezier(.2,.9,.3,1);
    transform-style: preserve-3d;
}

/* D6 dot face */
.d6-face {
    width: 76px; height: 76px;
    display: flex; flex-direction: column;
    gap: 5px; padding: 9px; box-sizing: border-box;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.32), inset 0 0 0 2px rgba(0,0,0,0.05);
}

.d6-row { display: flex; gap: 5px; justify-content: space-between; }

.d6-pip {
    width: 14px; height: 14px;
    background: #1A1A2E;
    border-radius: 50%;
    opacity: 0;
    margin: 0 auto;
    transition: opacity 0.1s;
}

/* Numeric face for D4/D8/D10/D12/D20 */
.num-face {
    width: 76px; height: 76px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.32);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--dr-text);
}

/* Sum + values row */
.dr-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dr-sum-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.50);
}

.dr-sum-value {
    font-size: 1.65rem;
    font-weight: 900;
    color: #FF8C42;
    line-height: 1;
}

.dr-values-line {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.40);
    margin-top: 3px;
    text-align: right;
}

/* ── Stats Bar ──────────────────────────────────────────── */
.dr-stats-bar {
    background: var(--dr-surface);
    border-bottom: 1px solid var(--dr-border);
    padding: 0.85rem 0;
}

.dr-stats-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.dr-stat { text-align: center; }
.dr-stat .st-label {
    font-size: 0.69rem;
    color: var(--dr-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
}
.dr-stat .st-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--dr-text);
    line-height: 1.15;
}

/* ── Shared Wrappers ────────────────────────────────────── */
.dr-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.dr-section { padding: 3.5rem 0; }
.dr-section.bg-alt { background: var(--dr-surface-2); }

.dr-sec-head { text-align: center; margin-bottom: 2.25rem; }

.dr-sec-head .dr-eyebrow {
    margin-bottom: 0.6rem;
}

.dr-sec-head h2 {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    color: var(--dr-text);
    margin: 0 0 0.45rem;
    letter-spacing: -0.01em;
}

.dr-sec-head p {
    font-size: 0.93rem;
    color: var(--dr-muted);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── History Card ───────────────────────────────────────── */
.dr-history-card {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    overflow: hidden;
    box-shadow: var(--dr-shadow-sm);
}

.dr-hist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.35rem;
    background: var(--dr-surface-2);
    border-bottom: 1px solid var(--dr-border);
}

.dr-hist-head h3 { font-size: 0.97rem; font-weight: 700; color: var(--dr-text); margin: 0; }

.btn-clr-hist {
    height: 30px;
    padding: 0 12px;
    background: transparent;
    color: #EF4444;
    border: 1px solid #EF4444;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-clr-hist:hover { background: #EF4444; color: #fff; }

.dr-hist-body { padding: 1rem 1.35rem; min-height: 72px; }

.dr-hist-empty {
    text-align: center;
    color: var(--dr-muted);
    font-size: 0.87rem;
    padding: 0.5rem 0;
}

.dr-hist-list { list-style: none; padding: 0; margin: 0; }

.dr-hist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dr-border);
    font-size: 0.84rem;
}

.dr-hist-item:last-child { border-bottom: none; }
.dr-hist-item .hi-type { font-weight: 700; color: var(--dr-brand); min-width: 44px; }
.dr-hist-item .hi-vals { color: var(--dr-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-hist-item .hi-sum  { font-weight: 800; min-width: 32px; text-align: right; }
.dr-hist-item .hi-time { color: var(--dr-muted); font-size: 0.71rem; min-width: 52px; text-align: right; }

/* ── Dice Gallery ───────────────────────────────────────── */
.dr-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.dr-die-card {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.dr-die-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dr-brand), var(--dr-accent));
    opacity: 0;
    transition: opacity 0.2s;
}

.dr-die-card:hover { transform: translateY(-4px); box-shadow: var(--dr-shadow-md); border-color: var(--dr-brand); }
.dr-die-card:hover::before { opacity: 1; }
.dr-die-card:active { transform: translateY(-1px); }

.die-icon-box {
    width: 58px; height: 58px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--dr-brand), #FF6B35);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.9rem;
    box-shadow: 0 4px 14px rgba(232,93,4,0.38);
}

.dr-die-card h3 { font-size: 0.97rem; font-weight: 700; color: var(--dr-text); margin-bottom: 0.3rem; }
.dr-die-card p  { font-size: 0.80rem; color: var(--dr-muted); margin: 0 0 0.7rem; line-height: 1.55; }

.dr-die-card .select-hint {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--dr-brand);
    opacity: 0;
    transition: opacity 0.2s;
    display: block;
}

.dr-die-card:hover .select-hint { opacity: 1; }

/* ── Features ───────────────────────────────────────────── */
.dr-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.dr-feat-card {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    padding: 1.4rem;
    transition: box-shadow 0.2s;
}

.dr-feat-card:hover { box-shadow: var(--dr-shadow-sm); }

.dr-feat-icon { font-size: 1.6rem; margin-bottom: 0.65rem; }
.dr-feat-card h3 { font-size: 0.91rem; font-weight: 700; color: var(--dr-text); margin-bottom: 0.3rem; }
.dr-feat-card p  { font-size: 0.80rem; color: var(--dr-muted); margin: 0; line-height: 1.6; }

/* ── How-To Steps ───────────────────────────────────────── */
.dr-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    position: relative;
}

.dr-steps::before {
    content: '';
    position: absolute;
    top: 26px; left: 12%; right: 12%;
    height: 2px;
    background: linear-gradient(90deg, var(--dr-brand) 0%, var(--dr-accent) 100%);
    opacity: 0.18;
    pointer-events: none;
}

.dr-step {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    padding: 1.4rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.dr-step-num {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dr-brand), #FF6B35);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
    box-shadow: 0 4px 12px rgba(232,93,4,0.38);
}

.step-icon { font-size: 1.45rem; margin-bottom: 0.6rem; }
.dr-step h3 { font-size: 0.91rem; font-weight: 700; color: var(--dr-text); margin-bottom: 0.3rem; }
.dr-step p  { font-size: 0.80rem; color: var(--dr-muted); margin: 0; line-height: 1.6; }

/* ── Use Cases ──────────────────────────────────────────── */
.dr-usecases {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem;
}

.dr-uc-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    padding: 1.35rem;
    transition: box-shadow 0.2s;
}

.dr-uc-card:hover { box-shadow: var(--dr-shadow-sm); }

.dr-uc-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: rgba(232,93,4,0.08);
    font-size: 1.45rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.dr-uc-card h3 { font-size: 0.93rem; font-weight: 700; color: var(--dr-text); margin-bottom: 0.28rem; }
.dr-uc-card p  { font-size: 0.80rem; color: var(--dr-muted); margin: 0; line-height: 1.6; }

/* ── Related Tools ──────────────────────────────────────── */
.dr-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dr-tool-card {
    background: var(--dr-surface);
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius);
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dr-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--dr-shadow-sm);
    border-color: var(--dr-brand);
    text-decoration: none;
}

.dr-tool-card .tc-icon { font-size: 1.8rem; margin-bottom: 0.45rem; }
.dr-tool-card h4 { font-size: 0.86rem; font-weight: 700; color: var(--dr-text); margin-bottom: 0.22rem; }
.dr-tool-card .tc-desc { font-size: 0.76rem; color: var(--dr-muted); margin-bottom: 0.5rem; line-height: 1.45; }
.dr-tool-card .tc-link { font-size: 0.76rem; color: var(--dr-brand); font-weight: 700; }

/* ── FAQ Accordion ──────────────────────────────────────── */
.dr-faq-list { max-width: 760px; margin: 0 auto; }

.dr-faq-item {
    border: 1px solid var(--dr-border);
    border-radius: var(--dr-radius-sm);
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.dr-faq-q {
    width: 100%;
    text-align: left;
    background: var(--dr-surface);
    border: none;
    padding: 1rem 1.2rem;
    font-size: 0.91rem;
    font-weight: 700;
    color: var(--dr-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.dr-faq-q:hover { background: var(--dr-surface-2); }

.faq-plus {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--dr-brand);
    flex-shrink: 0;
    transition: transform 0.25s;
    line-height: 1;
}

.dr-faq-item.open .dr-faq-q { background: var(--dr-surface-2); }
.dr-faq-item.open .faq-plus { transform: rotate(45deg); }

.dr-faq-a {
    display: none;
    padding: 0 1.2rem 1rem;
    font-size: 0.87rem;
    color: var(--dr-muted);
    line-height: 1.72;
    background: var(--dr-surface);
}

.dr-faq-item.open .dr-faq-a { display: block; }

/* ── SEO Content ────────────────────────────────────────── */
.dr-seo-section { background: var(--dr-surface-2); padding: 3.5rem 0; }
.dr-seo-inner   { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }
.dr-seo-inner h2 { font-size: 1.2rem; font-weight: 800; color: var(--dr-text); margin: 2rem 0 0.55rem; }
.dr-seo-inner h2:first-child { margin-top: 0; }
.dr-seo-inner p  { color: var(--dr-muted); font-size: 0.89rem; line-height: 1.78; margin-bottom: 0.65rem; }
.dr-seo-inner ul { color: var(--dr-muted); font-size: 0.89rem; padding-left: 1.25rem; line-height: 1.8; margin-bottom: 0.65rem; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .dr-hero-inner { grid-template-columns: 1fr; gap: 2rem; }
    .dr-features   { grid-template-columns: repeat(2, 1fr); }
    .dr-gallery    { grid-template-columns: repeat(2, 1fr); }
    .dr-steps      { grid-template-columns: repeat(2, 1fr); }
    .dr-steps::before { display: none; }
    .dr-tools-grid { grid-template-columns: repeat(2, 1fr); }
    .dr-stats-inner { gap: 1.5rem; }
}

@media (max-width: 600px) {
    .dr-hero { padding: 2rem 0 2.5rem; }
    .dr-features, .dr-gallery, .dr-usecases, .dr-tools-grid { grid-template-columns: 1fr; }
    .dr-steps { grid-template-columns: 1fr; }
    .dr-die  { width: 66px; height: 66px; }
    .d6-face { width: 66px; height: 66px; }
    .num-face { width: 66px; height: 66px; font-size: 1.25rem; }
    .d6-pip  { width: 12px; height: 12px; }
    .dr-stats-inner { gap: 1rem; }
    .dr-stat .st-value { font-size: 1.25rem; }
}
