#star-calculator {
  box-sizing: border-box;
}



#star-calculator {
  --page-bg: #ece7e2;
  --card-bg: #ffffff;
  --ink: #2d2d2d;
  --line: #97864a;
}



#star-calculator {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--ink);
  background: var(--page-bg);
}



#star-calculator .page {
  width: min(900px, 96%);
  margin: 0 auto;
  padding: 22px 0 30px;
}



#star-calculator .page-header {
  margin-bottom: 18px;
}



#star-calculator .back-link {
  color: #6d3d80;
  text-decoration: none;
  font-size: 14px;
}



#star-calculator h1 {
  margin: 14px 0 0;
  font-size: clamp(26px, 4vw, 36px);
}



#star-calculator .star-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid #e7e0eb;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 8px 24px rgb(39 24 48 / 6%);
}



#star-calculator .star {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
}



#star-calculator .star-outline {
  fill: none;
  stroke: var(--line);
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}



#star-calculator .inner-lines {
  fill: none;
  stroke: #8a838b;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}



#star-calculator .node {
  stroke: #fff;
  stroke-width: 4;
}



#star-calculator .node-top,
#star-calculator .node-bottom-left,
#star-calculator .node-bottom-right {
  fill: #8d1729;
}



#star-calculator .node-left {
  fill: #b40bc5;
}



#star-calculator .node-right {
  fill: #d91f3f;
}



#star-calculator .main-number {
  fill: #fff;
  font-size: 23px;
  font-weight: 700;
  text-anchor: middle;
}



#star-calculator .inner-node circle {
  stroke: #fff;
  stroke-width: 3;
}



#star-calculator .inner-node text {
  fill: #fff;
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
}



#star-calculator .inner-blue { fill: #2563eb; }


#star-calculator .inner-cyan { fill: #06a5c9; }


#star-calculator .inner-green { fill: #16a34a; }


#star-calculator .inner-yellow { fill: #eab308; }


#star-calculator .inner-orange { fill: #f97316; }



@media (max-width: 600px){

  
#star-calculator .page {
    width: calc(100% - 12px);
    padding-top: 14px;
  }


  
#star-calculator .star-card {
    padding: 3px;
    border-radius: 12px;
  }


}



/* Visi iekšējie cipari, ieskaitot apakšējo pozīciju, ir vienādā izmērā */


#star-calculator .small-nodes circle {
  fill: #f0edef;
  stroke: #ffffff;
  stroke-width: 2.5;
}



#star-calculator .small-nodes text {
  fill: #4d454e;
  font-size: 17px;
  font-weight: 600;
  text-anchor: middle;
}



#star-calculator .theme-value-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}



#star-calculator .theme-value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #eee7f7;
  color: #65409a;
  font-weight: 600;
  font-size: 13px;
}


#star-calculator .theme-value-pill {
  cursor: pointer;
}


#star-calculator .theme-path {
  margin: 10px 0;
}



#star-calculator .theme-path .theme-value-list {
  display: flex;
}



/* Galvenā ceļa enerģijas */


#star-calculator .theme-value-pill.theme-main-path {
  background: #dceafe;
  color: #2857a4;
  border: 1px solid #b9d0f5;
}



/* Pārējās enerģijas paliek lillā */


#star-calculator .theme-value-pill {
  background: #eee7f7;
  color: #65409a;
}



/* Visu tēmu enerģijas */


#star-calculator .theme-value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 9px;
  margin: 2px;
  border-radius: 20px;
  background: #eee7f7;
  color: #65409a;
  font-size: 13px;
  font-weight: 600;
}



/* Galvenā ceļa enerģijas kopējā sarakstā */


#star-calculator .theme-value-pill.theme-main-path {
  background: #dceafe;
  color: #2857a4;
  border: 1px solid #b9d0f5;
}



/* Aprēķināšanas poga */


#star-calculator #calculateBtn,
#star-calculator #calculate,
#star-calculator button[type="submit"] {
  background: #65409a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}



/* Uzvedot kursoru */


#star-calculator #calculateBtn:hover,
#star-calculator #calculate:hover,
#star-calculator button[type="submit"]:hover {
  background: #503078;
  transform: translateY(-1px);
}



/* Nospiežot pogu */


#star-calculator #calculateBtn:active,
#star-calculator #calculate:active,
#star-calculator button[type="submit"]:active {
  transform: translateY(0);
}



/* Tastatūras pieejamība */


#star-calculator #calculateBtn:focus-visible,
#star-calculator #calculate:focus-visible,
#star-calculator button[type="submit"]:focus-visible {
  outline: 2px solid #a78bca;
  outline-offset: 3px;
}



/* Piecstaru zvaigznes kalkulatora poga */


#star-calculator #calculateBtn {
    min-width: 130px;
    min-height: 44px;
    padding: 10px 22px;
    border: none;
    border-radius: 12px;
    background: #a89652;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
}



#star-calculator #calculateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}



#star-calculator #calculateBtn:active {
    transform: translateY(0);
}



/* Dzimšanas datuma ievades lauks */


#star-calculator #birthDate {
    width: 280px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d8d1c7;
    border-radius: 12px;
    background: #fff;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}



/* Kad ievades lauks ir aktīvs */


#star-calculator #birthDate:focus {
    border-color: #a89652;
    box-shadow: 0 0 8px rgba(168, 150, 82, .25);
}



/* Datuma izvēles ikona */


#star-calculator #birthDate::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .75;
}



/* Mazākiem ekrāniem */


@media (max-width: 768px){

    
#star-calculator #birthDate {
        width: 100%;
        max-width: 320px;
        height: 48px;
        font-size: 16px;
    }


}


#star-calculator .energy-overview {
    margin: 30px 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #d8d1c7;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(70, 55, 35, 0.06);
}



#star-calculator .energy-overview h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #6e573e;
    font-size: 1.35rem;
}



#star-calculator .energy-overview-hint {
    margin-bottom: 20px;
    color: #766d62;
    font-size: 0.9rem;
}



#star-calculator .energy-overview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}



#star-calculator .overview-energy-group {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    background: #f7f3ee;
    border: 1px solid #e5ddd2;
    border-radius: 12px;
}



#star-calculator .overview-energy-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}



#star-calculator .overview-energy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 5px 8px;
    background: #eee5f5;
    color: #4f3b62;
    border: 1px solid #d8c8e6;
    border-radius: 50%;
    font-weight: 700;
    cursor: help;
    transition: transform 0.15s ease;
}



#star-calculator .overview-energy:hover {
    transform: scale(1.12);
    background: #e2d3ef;
}



#star-calculator .overview-energy-count {
    color: #6e573e;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}



@media (max-width: 600px){

    
#star-calculator .energy-overview {
        padding: 16px;
    }


    
#star-calculator .energy-overview-list {
        gap: 8px;
    }


}



#star-calculator .energy-modal[hidden] {
  display: none !important;
}



#star-calculator .energy-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(35, 29, 23, 0.65);
}



#star-calculator .energy-modal-content {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  background: #f4f0eb;
  color: #333;
  border: 1px solid #d8d1c7;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}



#star-calculator .energy-modal-content h2 {
  margin: 0 35px 24px 0;
  color: #6e573e;
}



#star-calculator .energy-modal-content h3 {
  margin-bottom: 8px;
  color: #6e573e;
  font-size: 1.05rem;
}



#star-calculator .energy-text-section {
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  line-height: 1.6;
}



#star-calculator .energy-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #a89652;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}



#star-calculator .energy-value-clickable {
  cursor: pointer;
}



#star-calculator .energy-value-clickable:hover {
  filter: brightness(0.94);
}



@media (max-width: 600px){

  
#star-calculator .energy-modal-content {
    padding: 20px 16px;
  }


}




/* Kompakti divu trijstūru izkārtojums pirmajā tēmas kartītē.
   Izmanto esošo kartītes platumu, to nepalielinot. */


#star-calculator .theme-card-triangles {
  min-width: 0;
  padding: 1rem;
}



#star-calculator .theme-triangle-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  min-width: 0;
}



#star-calculator .theme-triangle {
  min-width: 0;
  text-align: center;
}



#star-calculator .theme-triangle h3 {
  min-height: 2.5em;
  margin: 0 0 8px;
  font-size: clamp(0.72rem, 2.5vw, 0.9rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}



#star-calculator .triangle-values {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}



#star-calculator .triangle-top,
#star-calculator .triangle-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
}



#star-calculator .theme-triangle .theme-value-pill {
  box-sizing: border-box;
  min-width: 28px;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  flex: 0 1 32px;
  font-size: 0.78rem;
  border-radius: 50%;
}




/* Talantu izcelsmes norādes zem attiecīgajiem violetajiem skaitļiem. */


#star-calculator .triangle-item {
  display: flex;
  flex: 0 1 50%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  line-height: 1.15;
  color: #65409a;
}



#star-calculator .triangle-item .triangle-caption {
  display: block;
  max-width: 82px;
  margin-top: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.15;
}



#star-calculator .triangle-item .theme-value-pill {
  flex: 0 0 32px;
}



#star-calculator .theme-triangle .theme-purple-value {
  background: #eee7f7;
  color: #65409a;
  border: 1px solid #dfd0ef;
}



#star-calculator .theme-triangle .theme-blue-value {
  background: #dceafe;
  color: #2857a4;
  border: 1px solid #b9d0f5;
}



#star-calculator .theme-triangle-description {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}



@media (max-width: 360px){

  
#star-calculator .theme-card-triangles {
    padding: 0.7rem;
  }


  
#star-calculator .theme-triangle-pair {
    gap: 4px;
  }


  
#star-calculator .theme-triangle .theme-value-pill {
    width: 27px;
    height: 27px;
    min-width: 27px;
    flex-basis: 27px;
    font-size: 0.7rem;
  }


  
#star-calculator .triangle-item { font-size: 0.58rem; }

  
#star-calculator .triangle-item .triangle-caption { font-size: 0.58rem; }

  
#star-calculator .triangle-item .theme-value-pill { flex-basis: 27px; }


}




/* Pagātnes kļūdu uzraksts tikai zem zilā trijstūra. */


#star-calculator .triangle-caption {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}




/* Nodrošina, ka teksts "Pagātnes kļūdas" ir redzams zem zilajiem trijstūriem. */


#star-calculator .theme-triangle-blue .triangle-caption-past-errors {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  width: 100%;
  margin: 5px 0 0 !important;
  color: var(--ink) !important;
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  text-align: center !important;
}




/* Dzimtas dāvanu sadaļas virsraksti — tāds pats hierarhijas stils kā pārējā logā. */


#star-calculator .energy-modal-content .lineage-gift-section > h4:first-child {
  margin: 0 0 18px;
  color: #6e573e;
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: lowercase !important;
}



/* Pirmajam burtam jābūt lielajam: “Dāvanas pa tēva/mātes līniju”. */


#star-calculator .energy-modal-content .lineage-gift-section > h4:first-child::first-letter {
  text-transform: uppercase;
}



/* Apakšvirsraksti tādā pašā stilā kā “Praktiskie attīstības uzdevumi”. */


#star-calculator .energy-modal-content .lineage-gift-section > h4:not(:first-child) {
  margin: 18px 0 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none !important;
}



#star-calculator .energy-modal-content .lineage-gift-section > p {
  margin: 0 0 12px;
  line-height: 1.6;
}


#star-calculator { font-family: 'Montserrat', sans-serif; color:#2d2d2d; }
#star-calculator h2, #star-calculator h3 { font-family: 'Cormorant Garamond', serif; }


/* Integrētās lapas datuma ievades izkārtojums */
#star-calculator .calculator-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 auto 1.5rem;
  text-align: center;
}
#star-calculator .calculator-controls label {
  display: block;
  margin: 0;
  width: 100%;
  text-align: center;
}
#star-calculator #birthDate {
  display: block;
  width: min(100%, 320px);
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
}
#star-calculator #calculateBtn {
  display: block;
  margin: 8px auto 0;
}
#star-calculator #calcMessage {
  margin: 0;
  text-align: center;
}
