/* ===================================================== */
/* RUNY – modulární verze */
/* ===================================================== */

/* ====== KONTEJNER ====== */

.runy-app {
  max-width: 900px;
  margin: 0 auto;
}

/* ====== SEKCE APLIKACE ====== */

.runy-hero,
.runy-transition,
.runy-result {
  background: #0f0f12;
  padding: 80px 0;
  box-sizing: border-box;
  text-align: center;
}

/* Výchozí stavy */
.runy-hero { display: block; }
.runy-loading { display: none; }
.runy-initializing .runy-loading { display: block; }
.runy-initializing .runy-options { display: none; }

.runy-transition,
.runy-result {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
}

.runy-transition.active,
.runy-result.active {
  opacity: 1;
  pointer-events: auto;
}

/* ====== VNITŘNÍ OBSAH ====== */

.runy-inner,
.runy-transition-inner,
.runy-result-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* ===================================================== */
/* ÚVOD */
/* ===================================================== */

.runy-subtitle {
  color: #aaa;
  margin-bottom: 60px;
  font-size: 1.2rem;
}

.runy-link-message {
  max-width: 620px;
  margin: -30px auto 40px;
  padding: 12px 16px;
  color: #e0c27a;
  border: 1px solid rgba(200,164,93,0.4);
  background: rgba(200,164,93,0.06);
}

.runy-options {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.runy-card {
  width: 280px;
  padding: 40px 30px;
  cursor: pointer;
  border: 1px solid #2a2a2f;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 40%),
    linear-gradient(145deg, #1b1b1f, #16161a);
  transition: all 0.3s ease;
}

.runy-card:hover {
  border-color: #c8a45d;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.runy-symbol {
  font-size: 2.5rem;
  color: #b33a3a;
  margin-bottom: 20px;
}

.runy-card h2 {
  color: #fff;
  margin-bottom: 10px;
}

.runy-card p {
  color: #aaa;
  font-size: 0.95rem;
}

/* ===================================================== */
/* VÝSLEDEK */
/* ===================================================== */

.runy-result-symbol {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.runy-result h2 {
  color: #c8a45d;
  margin-bottom: 20px;
}

.runy-divider {
  width: 80px;
  height: 1px;
  background: #c8a45d;
  margin: 20px auto;
  opacity: 0.6;
}

.runy-result p,
.runa-text {
  color: #aaa;
  line-height: 1.7;
}

/* ====== TROJVÝKLAD ====== */

.runy-three { margin-top: 40px; }

.runa-block { margin-bottom: 60px; }

.runa-phase {
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #c8a45d;
  margin-bottom: 10px;
}

.runa-name {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 15px;
}

/* ====== PODROBNÉ VÝKLADY ====== */

.runy-detail-link {
  display: inline-block;
  margin-top: 8px;
  color: #c8a45d;
  text-decoration: none;
  border-bottom: 1px solid rgba(200,164,93,0.45);
  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}

.runy-detail-link::after {
  content: " ↗";
}

.runy-detail-link:hover,
.runy-detail-link:focus-visible {
  color: #e0c27a;
  border-color: #e0c27a;
}

.runy-detail-link[hidden] {
  display: none;
}

/* ====== SDÍLENÍ VÝSLEDKU ====== */

.runy-share {
  margin-top: 50px;
  text-align: center;
}

.runy-share[hidden],
.runy-link-message[hidden],
.runy-share-url[hidden] {
  display: none;
}

.runy-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.runy-action-button {
  padding: 12px 24px;
  color: #c8a45d;
  font: inherit;
  cursor: pointer;
  border: 1px solid #c8a45d;
  background: transparent;
  transition:
    color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.runy-action-button:hover,
.runy-action-button:focus-visible {
  color: #0f0f12;
  background: #c8a45d;
  box-shadow: 0 0 16px rgba(200,164,93,0.3);
}

.runy-share-status {
  min-height: 1.7em;
  margin: 14px auto 0;
  font-size: 0.9rem;
}

.runy-share-url {
  display: block;
  width: min(100%, 620px);
  box-sizing: border-box;
  margin: 12px auto 0;
  padding: 10px 12px;
  color: #ddd;
  font: inherit;
  border: 1px solid #2a2a2f;
  background: #141418;
}

/* ===================================================== */
/* KÁMEN */
/* ===================================================== */

.rune-stone,
.wyrd-stone {
  width: 140px;
  height: 190px;
  background: linear-gradient(145deg, #1a1a1e, #141418);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow:
    inset 0 0 12px rgba(0,0,0,0.7),
    0 12px 30px rgba(0,0,0,0.5);
}

/* ===================================================== */
/* ANIMACE SYMBOLU */
/* ===================================================== */

.rune-svg {
  width: 70px;
  height: auto;
  color: #2f2f35;
  overflow: visible;
}

.rune-svg path {
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

.runy-result.active .rune-svg {
  color: #b33a3a;
  animation: runeGlow 2.5s ease-in-out infinite 0.8s;
}

.runy-result.active .rune-svg path {
  animation: runeDraw 0.8s ease forwards;
}

@keyframes runeDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes runeGlow {
  0%   { filter: drop-shadow(0 0 4px rgba(179,58,58,0.2)); }
  50%  { filter: drop-shadow(0 0 14px rgba(179,58,58,0.5)); }
  100% { filter: drop-shadow(0 0 4px rgba(179,58,58,0.2)); }
}

/* ===================================================== */
/* Wyrd – CHAOS */
/* ===================================================== */

.wyrd-wrap {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.wyrd-chaos {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 40% 30%, rgba(200,164,93,0.8) 2px, transparent 3px),
    radial-gradient(circle at 60% 50%, rgba(200,164,93,0.7) 2px, transparent 3px),
    radial-gradient(circle at 50% 70%, rgba(200,164,93,0.6) 2px, transparent 3px),
    radial-gradient(circle at 30% 60%, rgba(200,164,93,0.6) 2px, transparent 3px),
    radial-gradient(circle at 70% 40%, rgba(200,164,93,0.6) 2px, transparent 3px);
}

.runy-transition.active .wyrd-chaos {
  animation: chaosAppear 1.2s ease forwards,
             chaosDrift 6s linear infinite 1.2s;
}

@keyframes chaosAppear {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes chaosDrift {
  0%   { transform: scale(1) rotate(0deg); }
  50%  { transform: scale(1.05) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

/* ===================================================== */
/* TABULKA KOMENTÁŘŮ */
/* ===================================================== */

.runy-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 60px;
  color: #ccc;
  background: #141418;
  border: 1px solid #2a2a2f;
}

.runy-table thead { background: #1a1a1e; }

.runy-table th {
  color: #c8a45d;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 14px 12px;
  border-bottom: 1px solid #2a2a2f;
}

.runy-table td {
  padding: 12px;
  border-bottom: 1px solid #222226;
  transition: background 0.3s ease;
}

.runy-table tr:hover td { background: #1f1f24; }

.runy-table tbody tr:last-child td {
  border-bottom: 1px solid #c8a45d;
}

.runy-table a {
  color: #c8a45d;
  text-decoration: none;
}

.runy-table a:hover { text-decoration: underline; }

.runy-table td:last-child {
  font-size: 1.2rem;
  color: #e0c27a;
}

/* ====== MALÉ SYMBOLY V SEZNAMU RUN ====== */

.runy-symbol-cell {
  width: 72px;
  text-align: center;
}

.runy-list-symbol {
  width: 26px;
  height: 32px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.runy-list-symbol .rune-svg {
  width: 19px;
  height: 30px;
  color: #e0c27a;
}

.runy-list-symbol .rune-svg path {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  filter: none;
  transition: none;
}

/* ====== SYMBOLY U NADPISŮ JEDNOTLIVÝCH RUN ====== */

.runy-detail-symbol {
  width: 36px;
  height: 48px;
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.runy-detail-symbol .rune-svg {
  width: 29px;
  height: 46px;
  color: #e0c27a;
}

.runy-detail-symbol .rune-svg path {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  filter: none;
  transition: none;
}

/* ====== RUNY – PLASTIČNOST SYMBOLU ====== */

.rune-svg path {
  stroke-linejoin: round;

  /* jemný vnitřní stín */
  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.15))
    drop-shadow(0 -1px 0 rgba(0,0,0,0.6));

  transition: 
    filter 0.6s ease,
    stroke 0.6s ease;
}

/* zvýraznění po zjevení */
.runy-result.active .rune-svg path {
  filter:
    drop-shadow(0 1px 0 rgba(255,255,255,0.2))
    drop-shadow(0 -2px 2px rgba(0,0,0,0.7))
    drop-shadow(0 0 8px rgba(179,58,58,0.4));
}

/* jemná světelná hloubka kamene */
.rune-stone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;

  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.02) 30%,
    transparent 60%
  );

  pointer-events: none;
}

/* spodní tmavší část – váha kamene */
.rune-stone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;

  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0,0,0,0.35) 100%
  );

  pointer-events: none;
}

/* ====== PŘECHOD K VÝSLEDKU ====== */

.runy-transition .wyrd-stone[role="button"] {
  cursor: pointer;
}

.runy-transition .wyrd-stone[role="button"]:focus-visible {
  outline: 2px solid #e0c27a;
  outline-offset: 6px;
}

.runy-transition-hint {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

/* ====== UKLÁDÁNÍ A HISTORIE VÝKLADŮ ====== */

.runy-save,
.runy-login-note {
  max-width: 680px;
  margin: 2rem auto 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid rgba(200, 164, 93, 0.35);
  text-align: left;
}

.runy-save label {
  display: block;
  margin-bottom: 0.6rem;
  color: #e0c27a;
  font-size: 1.3rem;
}

.runy-save textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.9rem;
  color: #eee7d7;
  background: #08070a;
  border: 1px solid #806a3e;
  font: 1.2rem/1.5 Georgia, serif;
  resize: vertical;
}

.runy-save-capacity,
.runy-history-capacity,
.runy-save-status,
.runy-history-status,
.runy-login-note {
  color: #bdb4a5;
}

.runy-save-status,
.runy-history-status {
  min-height: 1.4em;
}

.runy-daily-note {
  max-width: 680px;
  margin: 1.5rem auto;
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(200, 164, 93, 0.27);
  border-bottom: 1px solid rgba(200, 164, 93, 0.27);
  color: #cfc1a5;
  font-size: 1rem;
  line-height: 1.65;
  text-align: center;
}

.runy-daily-note strong {
  color: #e0c27a;
}

.runy-admin-test {
  margin: 1rem auto 1.75rem;
  text-align: center;
}

.runy-admin-reset {
  padding: 0.65rem 1rem;
  border: 1px solid rgba(179, 58, 58, 0.7);
  border-radius: 3px;
  background: rgba(80, 20, 20, 0.35);
  color: #d9b5b5;
  font: 0.95rem/1.4 Georgia, serif;
  cursor: pointer;
}

.runy-admin-reset:hover,
.runy-admin-reset:focus-visible {
  border-color: #b33a3a;
  color: #f0d4d4;
}

.runy-admin-reset:disabled {
  cursor: wait;
  opacity: 0.65;
}

.runy-admin-reset-status {
  min-height: 1.4em;
  margin: 0.55rem 0 0;
  color: #bdb4a5;
}

.runy-history {
  color: #ccc;
}

.runy-history > h2,
.runy-history > .runy-history-capacity {
  text-align: center;
}

.runy-history-item {
  padding: 2rem 0;
  border-top: 1px solid rgba(200, 164, 93, 0.35);
}

.runy-history-date {
  color: #a99877;
  font-size: 0.95rem;
}

.runy-history-runes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.runy-history-rune {
  padding: 1rem;
  background: #141418;
  border: 1px solid #2a2a2f;
  text-align: center;
}

.runy-history-rune h4,
.runy-history-rune h5,
.runy-history-note h4 {
  color: #e0c27a;
}

.runy-history-stone .rune-stone {
  margin: 1rem auto;
}

/* Uložený výklad je statický: symbol musí být viditelný bez animace výsledku. */
.runy-history-stone .rune-svg {
  color: #b33a3a;
  filter: drop-shadow(0 0 5px rgba(179, 58, 58, 0.45));
}

.runy-history-stone .rune-svg path {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

.runy-history-rune-meaning,
.runy-history-note {
  text-align: left;
}

.runy-delete-saved {
  margin-top: 1rem;
  padding: 0;
  color: #c9b58c;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.runy-delete-saved:hover,
.runy-delete-saved:focus {
  color: #fff0c5;
}
