/* ---- setup ---- */

@font-face {
    font-family: 'Agency FB Bold';
    font-style: normal;
    font-weight: normal;
    src: local('Agency FB Bold'), url('/fonts/AGENCYB.woff') format('woff');
}

* {
    box-sizing: border-box;
    word-wrap: break-word;
}

html {
    min-height: 100%;
    scroll-padding-top: 50px;
}

:root {
    --body-bg-color: #ccc;
    --dark-pink: #c9337b;
    --light-pink: #ff6bc0;
    --border-color: #333;
    --alt-bg-color: #ddd;
    --alt-alt-bg-color: #bbb;
    --pink-hl-color: #FFD5E9;
    --pink-alt-hl-color: #FFB7DA;
    --user-bar-color: #555;
    --green-color: #196300;
}

/* ---- global styles ---- */

html {
    height: 100%;
}

body {
    margin: 0;
    height: 100%;
    background-color: var(--body-bg-color);
    background-image: url(/image/background.png);
    background-size: 200px 200px;
    background-position: -50px -50px;
    background-repeat: repeat;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
}

h1 {
    font-weight: bold;
    margin: 20px 0;
}

h2 {
    margin: 10px 0;
}

p:first-child {
    margin-top: 0;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--dark-pink);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

hr {
    border-top: 1px solid var(--dark-pink);
    border-right: none;
    border-left: none;
    border-bottom: none;
}

#logo-header {
    width: 100%;
    height: 150px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5)),
                url(/image/PiggyBankOutlineTransparentVector5.svg) no-repeat top 40px right 15%/auto 130%,
                linear-gradient(to right, transparent, var(--dark-pink) 80%),
                radial-gradient(var(--light-pink), var(--dark-pink)) repeat center/43px 43px;
    position: relative;
    text-shadow: 2px 2px 5px black;
}

#logo-header a {
    color: white;
}

#logo-text {
    color: white;
    flex-grow: 1;
}

#logo-text a {
    font-size: 48px;
    font-family: 'Agency FB Bold', sans-serif;
    color: inherit;
    text-decoration: none;
}

#motto-text {
    color: white;
    font-style: oblique;
    font-size: 15px;
}

#pig-box {
    width: 75px;
    height: 75px;
    margin-left: 10px;
    flex-grow: 0;
}

#pig-box img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.75);
}

#body-container {
    flex: 1 0 auto;
}

#container-box {
    border: 2px solid var(--border-color);
    background-color: white;
    color: #222;
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    margin-top: 25px;
}

#content-container {
    padding: 25px;
}

#nav {
    padding: 0 20px;
    color: white;
    line-height: 1.8em;
    background: var(--border-color);
}

#nav a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

#nav a:hover {
    text-decoration: underline;
}

#user-bar {
    background-color: var(--user-bar-color);
    padding: 0 20px;
    color: white;
    line-height: 1.8em;
}

#user-bar a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

#user-bar a:hover {
    text-decoration: underline;
}

#user-hello {
    text-align: right;
    float: right;
    color: white;
    padding: 10px;
}

#logo-and-pig-container {
    position: absolute;
    bottom: 14px;
    display: flex;
    width: 100%;
    padding: 0 14px;
}

#footer {
    padding: 25px;
    font-style: oblique;
    background: linear-gradient(to bottom, transparent, var(--alt-bg-color));
    margin-top: 25px;
    flex-shrink: 0;
}

/* ---- utility styles ---- */

.no-top-margin {
    margin-top: 0;
}

/* ---- little styles ---- */

#login-notice, #flash-message {
    border: 1px solid #DABA61;
    background-color: #FDFFC8;
    padding: 10px;
    margin: 10px;
    margin-left: 10%;
    margin-right: 10%;
    font-style: oblique;
    font-size: 15px;
}

#login-notice a, #flash-message a {
    font-style: normal;
}

.small-note-text {
    font-size: 12px;
}

.price-text {
    font-size: 72px;
    font-family: 'Agency FB Bold', sans-serif;
}

.alltogethernow {
    display: inline-block;
}

.cool-banner {
    color: white;
    background-color: #891A14;
    background: linear-gradient(to right, transparent 0, #891A14 50px calc(100% - 50px), transparent 100%);
    font-weight: bold;
    padding: 15px 65px;
    max-width: 95%;
    width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cool-banner-inner {
    background-color: goldenrod;
    background: radial-gradient(white 0 70%, goldenrod 100%);
    padding: 3px;
}

.cool-banner-inner-2 {
    background-color: #891A14;
    padding: 20px;
}

.cool-banner a {
    color: var(--light-pink);
}

/* ---- advertisement ---- */

#login-notice + .totally-normal-image {
    margin-top: 0;
}

.totally-normal-image {
    margin: -18px auto 20px auto;
    width: 653px;
    max-width: 100%;
    user-select: none;
}

.totally-normal-image img {
    width: 653px;
    aspect-ratio: 653 / 76;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

.totally-normal-image::before {
    color: #888;
    font-size: 14px;
    content: 'Advertisement';

    width: 653px;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

.with-us {
    font-size: 14px;
    text-align: center;
}

.with-us a {
    color: blue;
    text-decoration: underline;
    font-weight: normal;
}

.normal-image {
    display: block;
    margin: 25px auto;
    max-width: 100%;
}


.normal-image-in-context {
    display: block;
    max-width: 100%;
}

/* ---- form classes ---- */

.miniform {
    border: 1px solid var(--border-color);
    max-width: 400px;
    margin: 20px auto;
    padding: 25px;
}

.form-footer {
    font-style: oblique;
    font-size: 10px;
}

.form-row {
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.form-row:last-child {
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: none;
}

input[type="checkbox"] + label {
    display: inline;
}

.form-row label {
    display: block;
}

.form-row input[type="text"] {
    display: block;
}

.form-row input[type="password"] {
    display: block;
}

/* ---- index page styles ---- */

.index-page-screenshot {
    width: 100px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin-bottom: 5px;
}

.index-page-screenshot.right {
    margin-left: 20px;
    float: right;
}

.index-page-screenshot.left {
    margin-right: 20px;
    float: left;
}

/* ---- stock page styles ---- */

.stock-info {
    max-width: 600px;
    border: 1px solid var(--border-color);
    margin: 10px auto;
    padding: 25px;
    /*display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-end;*/
}

.stock-info-left {
    flex-grow: 1;
}

.stock-info-right {
    flex-grow: 0;
    text-align: right;
}

.stock-action-button-container {
    float: right;
}

.stock-table-container {
    max-width: 1024px;
    margin: 0 auto;
}

.stock-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 5px;
}

.stock-table.ownership {
    max-width: 600px;
    margin: 0 auto;
}

.stock-table.ownership.big {
    max-width: 800px;
}

.stock-table.ownership td {
    text-align: center;
    height: 3rem;
}

.stock-table.leaderboard {
    max-width: 600px;
    margin: 0 auto;
}

.stock-table.leaderboard td {
    text-align: center;
}

.stock-table.auction-info td {
    text-align: center;
}

.stock-table.leaderboard tbody tr.normal-row.first-place {
    background: linear-gradient(to right, #E3D068 0, transparent 49% 51%, #E3D068 100%);
}

.stock-table.leaderboard tbody tr.normal-row.second-place {
    background: linear-gradient(to right, #9A9788 0, transparent 49% 51%, #9A9788 100%);
}

.stock-table.leaderboard tbody tr.normal-row.third-place {
    background: linear-gradient(to right, #B47D58 0, transparent 49% 51%, #B47D58 100%);
}

.stock-table.leaderboard tbody tr.normal-row.fourth-place {
    background: linear-gradient(to right, #D385AA 0, transparent 49% 51%, #D385AA 100%);
}

.stock-table.leaderboard tbody tr.normal-row.fifth-place {
    background: linear-gradient(to right, #A986D4 0, transparent 49% 51%, #A986D4 100%);
}

.stock-table.leaderboard tbody tr.normal-row.sixth-place {
    background: linear-gradient(to right, #84BAD3 0, transparent 49% 51%, #84BAD3 100%);
}

.stock-table.leaderboard tbody tr.normal-row.seventh-place {
    background: linear-gradient(to right, #84D39E 0, transparent 49% 51%, #84D39E 100%);
}

.stock-table.leaderboard tbody tr.normal-row.second-place:hover,
.stock-table.leaderboard tbody tr.normal-row.fourth-place:hover,
.stock-table.leaderboard tbody tr.normal-row.sixth-place:hover {
    background: var(--pink-hl-color);
}

.stock-table.leaderboard tbody tr.normal-row.first-place:hover,
.stock-table.leaderboard tbody tr.normal-row.third-place:hover,
.stock-table.leaderboard tbody tr.normal-row.fifth-place:hover,
.stock-table.leaderboard tbody tr.normal-row.seventh-place:hover {
    background: var(--pink-alt-hl-color);
}

.stock-table.leaderboard tbody tr.hidden-row {
    display: none;
    background: linear-gradient(to bottom, #8CB8DE 0, transparent 49% 51%, #8CB8DE 100%);
}

.stock-table tbody tr.total-row:nth-child(n) {
    background: linear-gradient(to right, #B7D8E4 0, transparent 49% 51%, #B7D8E4 100%);
}

.stock-table td.money-cell {
    text-align: right;
}

.stock-table.list {
    margin-left: 5px;
    margin-right: 5px;
}

.stock-table td, .stock-table th {
    border: 1px solid var(--border-color);
    padding: 4px;
}

.stock-table thead th {
    background: var(--border-color);
    color: white;
}

.stock-table tbody tr:nth-child(even) {
    background: white;
}

.stock-table tbody tr:nth-child(odd) {
    background: var(--alt-bg-color);
}

.stock-table tbody tr:nth-child(even):hover {
    background: var(--pink-hl-color);
}

.stock-table tbody tr:nth-child(odd):hover {
    background: var(--pink-alt-hl-color);
}

.stock-deal {
    text-align: right;
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    padding: 25px;
}

.stock-deal-desc {
    text-align: left;
}

.stock-deal input[type="number"] {
    display: block;
    font-size: 30px;
    width: 100%;
    border: 1px solid #888;
    text-align: right;
    margin: 10px 0;
}

.stock-deal input[type="number"]:active {
    border: 1px solid #555;
}

.price-history-graph {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 528px;
    margin: 0 auto;
}

.stock-move {
    white-space: nowrap;
}

.small {
    font-size: 14px;
}

.value.big {
    font-size: 20px;
}

.stock-move.big {
    font-size: 20px;
}

.stock-move.up {
    color: #007602;
}

.stock-move.down {
    color: #A30007;
}

img.company-logo {
    display: block;
    margin: 0 auto 10px auto;
    width: 480px;
    height: auto;
    max-width: 100%;
}

h1.below-logo-symbol {
    margin-top: 0;
    text-align: center;
}

/* ---- small screens ---- */

.show-on-small-screen-inline {
    display: none;
}

@media screen and (max-width: 700px) {
    .show-on-small-screen-inline {
        display: inline;
    }

    #footer {
        /* Copyright notice still readable with :) button */
        margin-top: 10px;
        padding-bottom: 80px;
    }

    #content-container {
        padding: 15px;
    }

    #user-bar {
        padding: 0 15px;
    }

    #nav {
        padding: 0 15px;
    }

    .stock-info {
        padding: 10px;
    }

    .stock-table-container {
        margin-left: -10px;
        margin-right: -10px;
    }

    .hide-on-small-screen {
        display: none;
    }

    .totally-normal-image {
        margin-top: 0;
        margin-left: -15px;
        margin-right: -15px;
        max-width: calc(100% + 30px);
    }

    .totally-normal-image::before {
        padding-left: 5px;
        max-width: calc(100% - 5px);
    }

    .stock-table td.username-cell {
        max-width: 130px;
    }

    .stock-table-container .stock-table {
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
        border-left: none;
        border-right: none;
    }

    .stock-table-container .stock-table tr td:first-child, .stock-table tr th:first-child {
        border-left: none;
    }

    .stock-table-container .stock-table tr td:last-child, .stock-table tr th:last-child {
        border-right: none;
    }

    body button.in-table,
    body a.button-type-link.in-table,
    body input[type="submit"].in-table {
        padding: 0 5px;
        font-size: 16px;
    }

    img.company-logo {
        margin-top: 15px;
    }

    body #ticker .market-status {
        height: 100%;
        border: 2px solid var(--alt-bg-color);
    }
}

@media screen and (max-width: 1200px) {
    #container-box {
        margin-top: 0;
        margin-bottom: 100px;
        border-top: none;
        border-left: none;
        border-right: none;
    }
}

/* ---- ticker ---- */

html.admin-page #ticker {
    display: none;
}

@media screen and (prefers-reduced-motion: reduce) {
    #ticker {
        display: none;
    }
}

#ticker {
    background-color: var(--border-color);
    color: white;
    white-space: nowrap;
    padding: 5px;
    overflow-x: hidden;
    user-select: none;
    position: relative;
}

#ticker .market-status {
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--alt-bg-color);
    color: black;
    padding: 4px 16px;
}

#ticker .marquee {
    animation: scroll-left 50s linear infinite;
    transform: translateX(0%);
    display: flex;
    width: 9600px;
}

#ticker .tick {
    flex-grow: 0;
    flex-basis: 200px;
    width: 200px;
    margin: 0;
    text-align: center;
}

#ticker .marquee .stock-move.up {
    color: #36EA2E;
}

#ticker .marquee .stock-move.down {
    color: #FF7979;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-4800px);
    }
}

/* ---- pie chart ---- */

.pie-chart {
    width: 250px;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.pie-chart-legend-entry {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
}

.pie-chart-legend-box {
    flex-grow: 0;
    flex-shrink: 0;
    width: 1.4em;
    height: 1.4em;
    display: inline-block;
    border: 1px solid var(--border-color);
    margin-top: 2px;
}

.pie-chart-legend-label {
    flex: 1 1 auto;
    padding: 3px 5px 0 5px;
}

/* ---- ai ---- */

#ai-chat-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: var(--green-color);
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    padding: 5px;
    cursor: pointer;
}

#ai-chat-button img {
    aspect-ratio: 1 / 1;
    max-width: 100%;
}

#ai-chat-window {
    position: fixed;
    right: 20px;
    bottom: 0;
    width: 300px;
    height: 420px;
    background-color: white;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#ai-chat-box {
    background-color: var(--alt-bg-color);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
}

#ai-chat-box .title-bar {
    background-color: var(--green-color);
    color: white;
    font-weight: bold;
    user-select: none;
    padding: 10px;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
    flex-grow: 0;
}

#ai-chat-window .input-bar {
    flex-grow: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

#ai-chat-window .input-bar input {
    flex: 1 0 auto;
    padding: 10px;
    border: none;
    box-shadow: inset 0 0 5px lightgrey;
    border-radius: 0;
}

#ai-chat-window .input-bar button.important-button {
    flex-grow: 0;
    padding: 10px;
    margin: 0;
    cursor: pointer;
}

#ai-chat-close-button {
    float: right;
    cursor: pointer;
}


#ai-chat-window .chat-window {
    flex: 1 0 auto;
    height: 0;
}

#ai-chat-window #ai-chat-content {
    width: 100%;
    height: 100%;
    padding: 10px;
    overflow-y: scroll;
}

#ai-chat-window .bubble {
    max-width: 225px;
    display: block;
    text-align: left;
    padding: 10px;
    border-radius: 10px;
    clear: both;
    margin-bottom: 10px;
    word-wrap: break-word;
}

#ai-chat-window .bubble.left {
    float: left;
    background-color: white;
    border-top-left-radius: 0;
}

#ai-chat-window .bubble.right {
    float: right;
    background-color: var(--alt-alt-bg-color);
    border-top-right-radius: 0;
}

#ai-chat-window .bubble.center {
    color: grey;
    width: 100%;
    max-width: 100%;
    background: transparent;
    text-align: center;
    font-size: 14px;
    margin-bottom: 0;
    padding: 0 10px;
    user-select: none;
}

/* ---- news ---- */

h2.news-title {
    margin-bottom: 2px;
}

.news-dateline {
    color: #555;
    font-size: 14px;
    margin-bottom: 10px;
}

.news-post {
    max-width: 700px;
    margin: 0 auto;
    text-align: justify;
    text-justify: inter-word;
}

.unread {
    position: relative;
}

.unread::after {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    content: '';
    display: block;
    position: absolute;
    top: -2px;
    right: -6px;
    background: red;
    box-shadow: 0 0 5px white;
}

.oink {
    margin-top: 10px;
}

.oinks-list {
    text-align: left;
    font-style: oblique;
    color: #555;
    font-size: 14px;
    margin-top: 10px;
}

/* ---- control styles ---- */

td.has-button {
    text-align: center;
}

button, a.button-type-link, input[type="submit"] {
    border-radius: 0;
    padding: 4px 20px;
    margin: 5px 0;
    background: white;
    border: 1px solid var(--border-color);
    font-size: 18px;
    font-weight: normal;
    color: black;
    cursor: default;
}

button.in-table,
a.button-type-link.in-table,
input[type="submit"].in-table {
    padding: 0 12px;
    font-size: 16px;
}

td button,
td a.button-type-link,
td input[type="submit"] {
    margin-top: 2px;
    margin-bottom: 2px;
}

button:hover,
a.button-type-link:hover,
input[type="submit"]:hover {
    background: var(--alt-bg-color);
    text-decoration: none;
}

button:active,
a.button-type-link:active,
input[type="submit"]:hover {
    background: var(--alt-alt-bg-color);
}

button:disabled,
input[type="submit"]:disabled {
    background: var(--alt-bg-color);
    border: 1px solid var(--alt-bg-color);
    color: #666;
    cursor: not-allowed;
}

button.important-button,
a.button-type-link.important-button,
input[type="submit"].important-button {
    background: var(--light-pink);
    color: white;
    font-weight: bold;
    border: 1px solid var(--light-pink);
}

button.important-button:hover,
a.button-type-link.important-button:hover,
input[type="submit"].important-button:hover {
    background: var(--dark-pink);
    border: 1px solid var(--dark-pink);
}

button.important-button:active,
a.button-type-link.important-button:active,
input[type="submit"].important-button:active {
    background: var(--light-pink);
    border: 1px solid var(--dark-pink);
}

button.important-button:disabled,
input[type="submit"].important-button:disabled {
    background: var(--alt-bg-color);
    border: 1px solid var(--alt-bg-color);
    color: #666;
}

.table-control {
    text-align: right;
    font-size: 12px;
}

.table-control a {
    font-style: normal;
    font-weight: normal;
}

.save-them {
    display: inline-block;
    width: 150px;
    text-align: center;
    transform: scaleX(1.5);
}

#money-hole {
    background: conic-gradient(#8F7FA6 0 90deg, #908EEE 90deg 180deg, #8F7FA6 180deg 270deg, #908EEE 270deg 100%) repeat center/25px 25px;
    width: 550px;
    max-width: 100%;
    margin: 20px auto;
    border: 20px solid #B8BBAA;
    border-radius: 20px;
    min-height: 500px;
}

#money-hole h1 {
    color: white;
    text-align: center;
    font-size: 64px;
    margin-top: 40px;
    margin-bottom: 0;
    user-select: none;
    font-family: 'Agency FB Bold', sans-serif;
}

#money-hole h2 {
    color: white;
    text-align: center;
    font-size: 32px;
    user-select: none;
    font-style: oblique;
    margin-top: 0;
    margin-bottom: 25px;
    font-family: 'Agency FB Bold', sans-serif;
}

#money-hole #money-hole-counter {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
}

#money-hole .counter-digit {
    border: 4px solid black;
    font-family: 'Agency FB Bold', sans-serif;
    font-weight: bold;
    font-size: 60px;
    display: inline-block;
    margin: 0 2px;
    color: black;
    text-align: center;
    padding: 2px;
    background: linear-gradient(to bottom, white, #B8BBAA);

    flex-basis: 50px;
    max-width: 15%;
    aspect-ratio: 1 / 1;
    height: auto;

    user-select: none;
}

#money-hole-counter::before {
    content: "$";
    color: white;
    font-size: 30px;
    width: 30px;
    text-align: right;
}

#money-hole-counter::after {
    content: "";
    color: white;
    font-size: 30px;
    width: 30px;
    text-align: left;
}

#money-hole-submit {
    color: white;
    text-align: center;
    margin-top: 20px;
}

#money-hole-submit input[type="number"] {
    margin-top: 20px;
}

#money-hole-submit input[type="submit"].important-button {
    box-shadow: 0 0 20px white;
}

.totally-normal-image::before {
    content: 'Our Gracious Host';
}

.money-hole-input-container {
    font-size: 24px;
}

.money-hole-input {
    font-weight: bold;
    text-align: right;
    color: black;
    width: 120px;
    font-size: 24px;
    box-shadow: 0 0 20px white;
}

@media screen and (max-width: 700px) {
    #money-hole {
        margin-left: -15px;
        margin-right: -15px;
        max-width: calc(100% + 30px);
        padding-left: 0;
        padding-right: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}
