@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,700|Quattrocento:700');

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: lighter;
    background: white;
    overflow: hidden;
}

@media screen and (prefers-reduced-motion: no-preference) {
    body.switched {
        transition: color 0.6s, background-color 0.6s;
    }
}

h1,
h2 {
    text-align: center;
    font-family: "Quattrocento", Georgia, 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 30pt;
    margin-bottom: 10px;
}

h2 {
    font-size: 14pt;
    font-style: italic;
    font-family: sans-serif;
    font-weight: lighter;
    color: #BBB;
}

.header {
    padding-top: 3em;
    padding-bottom: 3em;
}

/*
  Built-in class:
    # author: Name
*/
.byline {
    font-style: italic;
}

.written-in-ink {
    z-index: 3;
    font-size: 9pt;
    font-family: sans-serif;
    text-align: center;
    font-weight: 700;
    position: fixed;
    display: block;
    width: 100%;
    background: white;
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
    height: 14px;
    top: 0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .written-in-ink {
        transition: color 0.6s, background 0.6s;
    }
}

/* 
  Enables <iframe> support work on itch.io when using mobile iOS
*/
.outerContainer {
    position: absolute;
    display: block;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow: scroll;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin-top: 24px;
    background-size: cover;
    background-repeat: no-repeat;
}

@media screen and (max-width: 980px) {
    .outerContainer {
        margin-top: 44px;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.container {
    display: block;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 4em;
    background: white;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .switched .container {
        transition: background-color 0.6s;
    }
}

p {
    font-size: 13pt;
    color: #888;
    line-height: 1.7em;
    font-weight: lighter;
}

a {
    font-weight: 700;
    color: #b97c2c;
    font-family: sans-serif;
    text-decoration: none;
}

.unclickable {
    font-weight: 700;
    color: #4f3411;
    font-family: sans-serif;
    text-decoration: none;
    cursor: not-allowed;
}

a:hover {
    color: black;
}

@media screen and (prefers-reduced-motion: no-preference) {
    a {
        transition: color 0.6s;
    }

    a:hover {
        transition: color 0.1s;
    }
}

strong {
    color: black;
    font-weight: bold;
}

img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.container .hide {
    opacity: 0.0;
}

.container .invisible {
    display: none;
}

.container>* {
    opacity: 1.0;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .container>* {
        transition: opacity 1.0s;
    }
}

/*
  Class applied to all choices
  (Will always appear inside <p> element by default.)
*/
.choice {
    text-align: center;
    line-height: 1.7em;
}

/* 
  Class applied to first choice
*/
:not(.choice)+.choice {
    padding-top: 1em;
}

/*
  Class applied to choice links
*/
.choice a, .choice span {
    font-size: 15pt;
}

/* 
  Built-in class:
    The End # CLASS: end
*/
.end {
    text-align: center;
    font-weight: bold;
    color: black;
    padding-top: 20px;
    padding-bottom: 20px;
}

#controls {
    z-index: 4;
    font-size: 9pt;
    text-align: center;
    padding-bottom: 6px;
    position: fixed;
    right: 14px;
    top: 4px;
    user-select: none;
    background: white;
}

@media screen and (prefers-reduced-motion: no-preference) {
    #controls {
        transition: color 0.6s, background 0.6s;
    }
}

#controls [disabled] {
    color: #ccc;
}

#controls>*:not(:last-child):after {
    content: " | ";
}

@media screen and (max-width: 980px) {
    #controls {
        z-index: 2;
        padding-top: 24px;
        top: 0;
        left: 0;
        right: 0;
    }
}

/* 
  Dark Theme (Added in Inky 0.10.0)
    # theme: dark
*/

body.dark {
    background: black;
    color: white;
}

.dark h2 {
    color: #666;
}

.dark .container {
    background: black;
}

.dark .written-in-ink {
    background: black;
}

.dark a {
    color: #cc8f1a;
}
.dark .unclickable{
    color: #c4af87;
    cursor:not-allowed;
}

.dark a:hover {
    color: white;
}

@media screen and (prefers-reduced-motion: no-preference) {
    .dark a {
        transition: color 0.6s;
    }
}

.dark strong {
    color: white;
}

.dark #controls [disabled] {
    color: #444;
}

.dark .end {
    color: white;
}

.dark #controls {
    background: black;
}

/* Container for the whole bar chart */
.score-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  width: 100%;
  max-width: 500px;
}

/* Row wrapper organizing label, bar, and score number */
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Book Title Label */
.score-row > span:first-child {
  width: 140px;
  flex-shrink: 0;
  font-weight: 600;
  text-align: right;
  font-size: 0.95rem;
}

/* Outer track container for each bar */
.bar-container {
  flex: 1;
  height: 18px;
  background-color: #e9ecef;
  border-radius: 9px;
  overflow: hidden;
}

/* Animated filled progress bar */
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 9px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.flourish-divider {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 4px;
  color: #94a3b8;
  margin: 28px 0 20px;
}

/* =========================================================
   1. MAIN FEATURED MATCH COVER IMAGE
   ========================================================= */
.book-result-card img, 
.book-cover {
  height: 320px !important;    /* Tweak main cover height here */
  width: auto !important;     /* Keeps correct aspect ratio */
  max-width: 100%;
  display: block;
  margin: 0 auto 20px;        /* Center image + spacing below */
  border-radius: 6px;         /* Corner rounding */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Soft drop shadow */
}

/* =========================================================
   2. SCORE CHART LAYOUT
   ========================================================= */
.score-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;                  /* Gap between score rows */
  margin-top: 20px;
}

.score-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;       /* Spacing between image, label, bar, and score */
}

/* Strip out Ink's automatic paragraph breaks inside the chart */
.score-row p,
.score-chart p {
  margin: 0 !important;
  padding: 0 !important;
  display: contents !important;
}

/* =========================================================
   3. SMALL CHART THUMBNAILS
   ========================================================= */
.bar-thumb {
  display: inline-block !important;
  margin: 0 !important;
  width: auto !important;
  height: 60px !important;     /* Thumbnail height */
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   4. TITLE LABELS & NUMBERS
   ========================================================= */
.score-row > span:nth-of-type(1) {
  width: 140px;               /* Label width alignment */
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
}

.score-num {
  width: 30px;
  text-align: right;
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
  flex-shrink: 0;
}

/* =========================================================
   5. PROGRESS BARS
   ========================================================= */
.bar-container {
  flex: 1;
  height: 16px;               /* Bar track height */
  background-color: #e2e8f0;  /* Background track color */
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6); /* Bar gradient color */
  border-radius: 8px;
  transition: width 0.8s ease-out;
}

/* =========================================================
   6. COMPANION BOOK COVER
   ========================================================= */

/* Title heading */
.series-title {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #1e293b;
}

/* Companion Grid Layout (Forced to horizontal row) */
.series-companion-grid {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 24px !important;               /* Horizontal gap between books */
  margin-top: 15px !important;
  margin-bottom: 20px !important;
}

/* Neutralize Ink's automatic paragraph injection inside grid */
.series-companion-grid p {
  margin: 0 !important;
  padding: 0 !important;
  display: contents !important;
}

/* Vertical layout for individual companion book cards */
.companion-book {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Companion Book Cover Sizing */
.companion-cover {
  height: 110px !important;           /* Adjust height to tweak cover size */
  width: auto !important;
  display: block !important;
  margin: 0 !important;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.companion-book span {
  font-weight: 600;
  font-size: 0.88rem;
  color: #475569;
}