@charset "utf-8";

/* 共通レイアウト */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}
body {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100dvh;
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    padding: 1em 0 0;
    background-color: #f8f9fa;
    color: #333;
}

footer {
    text-align: center;
    padding: 1em;
    padding-bottom: calc(1em + env(safe-area-inset-bottom));
    color: #666;
    font-size: 0.9em;
}

h1, h2 {
    color: #222;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* フォーム全体 */
form:not(.noframe) {
    max-width: 700px;
    margin: 0 auto 2em auto;
    background: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.7em;
    margin-bottom: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

input[type="submit"],
button {
    background-color: #28a745;
    color: white;
    padding: 0.7em 1.2em;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
    background-color: #218838;
}

button.center {
    display: block;
    margin: 0 auto;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.4em;
}

ul {
    list-style-type: square;
    padding: 0 0 0 1em;
}

ul li {
    padding: .5em .5em .5em 0;
    border-bottom: 1px solid #ddd;
}

li:last-child {
    border-bottom: 0;
}

.quote {
    padding: 0 .5em 0 .8em;
}

.hint {
    font-size: .8em;
}

.youtube {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.youtube.newgame {
    width: 90%;
    max-width: 700px;
    margin: 0 auto;
}

.youtube iframe {
    width: calc((690px - 2.4em) / 2);
    height: auto;
    aspect-ratio: 16 / 9;
}

.youtube.newgame iframe {
    width: 100%;
}

.error {
    max-width: 700px;
    margin: 0 auto 1em auto;
    color: #f00;
}

/* マイページ用 */
.user-greeting {
    margin-bottom: 1.5em;
    font-size: 1.1em;
    text-align: center;
}

/* スタンプ一覧用テーブル */
.stamp-count {
    font-weight: bold;
}

.stamp-table {
    max-width: 700px;
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin: 0 auto 2em;
}

.stamp-table:has(+ p) {
    margin-bottom: 0;
}

.stamp-table th:nth-child(2) {
    width: 12em;
}
.stamp-table td:nth-child(2) {
    text-align: center;
}

.stamp-table th,
.stamp-table td {
    padding: 12px;
    border: 1px solid #dee2e6;
    word-break: keep-all;
    overflow-wrap: anywhere;
    text-align: left;
}

.stamp-table th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
}

.stamp-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.stamp-table.count th,
.stamp-table.count td {
    width: 50%;
}

.stamp-table.count td {
    text-align: right;
}

.stamp-table.count td[data-label="当選確率"] {
    text-align: center;
}


/* レスポンシブ対応 */
@media screen and (max-width: 747px) {
    .youtube iframe {
        width: 100%;
    }
}

@media screen and (max-width: 600px) {
    body {
        margin: 1em;
    }

    form {
        padding: 1em;
    }

    h1 {
        font-size: 1.4em;
    }

    .stamp-table th,
    .stamp-table td {
        padding: 10px;
        font-size: 0.9em;
    }
}

section:not(.links) {
    background-color: #ffffff;
    padding: 1.2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 700px;
    margin: 0 auto 2em;
}

section.links, p.links {
    max-width: 700px;
    margin: 0 auto 2em;
    font-size: .9em;
}

p.note {
    font-size: .75em;
}

h1 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 1em;
}

.index-page h2 {
    display: inline-block;
    width: 100%;
    border-bottom: 1px solid #666;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0.5em;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.index-page h2::before {
    content: '▼';
    display: inline-block;
    position: relative;
    top: -2.5px;
    margin-right: .3em;
    color: #666;
    text-shadow:
      1px 1px 0 #333,
      2px 2px 0 #444,
      3px 3px 0 #555,
      4px 4px 0 #666;
}

.index-page h3 {
    position: relative;
    margin-left: 0.5em;
    padding-left: 1.2em;
    border: 1px solid #666;
    border-left: 0;
    border-top-left-radius: 0.8em;
    border-bottom-left-radius: 0.8em;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.index-page h3::before {
    content: '';
    position: absolute;
    left: -0.2em;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;

    border-top: 0.5em solid transparent;
    border-bottom: 0.5em solid transparent;
    border-left: 0.7em solid #666;

    filter:
      drop-shadow(0.8px 0.2px 0 #444)
      drop-shadow(1.6px 0.4px 0 #555)
      drop-shadow(2.4px 0.6px 0 #666);
}

.index-page h3::after {
    content: '';
    position: absolute;
    left: -0.15em;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;

    border-top: 0.45em solid transparent;
    border-bottom: 0.45em solid transparent;
    border-left: 0.6em solid #efefef;
}

.index-page h4 {
    margin-left: 0.6em;
    padding: 0 0 0 0.3em;
    background-color: #efefef;
    border-radius: 6px;
}

.index-page h4::before {
    content: '》';
    display: inline-block;
    margin-left: 0.4em;
    margin-right: -0.1em;
    color: #666;
}

.prizes {
    margin: 0.2em 0.8em;
    padding: 0;
    list-style: none;
}

.prizes li {
    display: flex;
    align-items: stretch;
    gap: 0.3em;
    margin-bottom: 0.5em;
}

.prizes li strong {
    flex: 0 0 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #666;
    color: white;
    font-weight: bold;
}

.prizes li .prize-content {
    flex: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 0.3em 0;
    text-align: center;
}

.prizes .note {
    font-size: 0.75em;
}

.num-winner {
    flex: 0 0 3.5em;
    align-self: center;
    background-color: #42b3f5;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 0.2em;
    border-radius: 4px;
}

.subcontents {
    padding: 0 0.3em 0 0.6em;
}

:root {
    --condition-label-width: 4.2em;
}

.tier-conditions {
    width: 100%;
    margin: 0 auto;
}

.tier-conditions li {
    list-style-type: none;
    margin-bottom: 0.8em;
    padding: 1em;
    border: 1px solid #aaa;
    border-radius: 8px;
}

.tier-conditions strong.tier-label::before {
    content: '';
    position: absolute;
    display: inline-block;
    width: calc(100% + 0.5em);
    height: 40%;
    margin-left: -0.4em;
    bottom: 0.1em;
    background-color: #f5dd42;
    border-radius: 2px;
    opacity: 0.6;
    z-index: -1;
}

.tier-conditions strong.tier-label {
    position: relative;
    display: inline-block;
    font-size: 1.1em;
    margin: 0 0 0.3em 0;
    z-index: 0;
}

.tier-conditions .tier-badge {
    display: inline-block;
    margin-left: 0.8em;
    padding: 0.1em 0.8em;
    background-color: #ffecb3;
    color: #b36b00;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 1em;
    position: relative;
}

.tier-conditions .tier-badge::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #ffecb3;
}

.tier-conditions .conditions {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    margin-top: 0.3em;
}

.tier-conditions .condition {
    display: flex;
    align-items: center;
}

.tier-conditions .condition p {
    margin: 0;
    align-self: flex-start;
}

.tier-conditions .condition strong {
    flex: 0 0 var(--condition-label-width);
    background-color: #f9f2e8;
    border: 1px solid #e6d8c3;
    border-radius: 5px;
    padding: 0.1em 0.4em;
    font-weight: bold;
    font-size: 0.95em;
    margin-right: 0.4em;
    text-align: center;
}

.tier-conditions .condition p {
    flex: 1;
    margin: 0;
}

.tier-conditions .condition-and {
    display: block;
    width: fit-content;
    margin: 0.3em 0;
    padding: 0.1em 0.5em;
    background: #fff7f0;
    color: #d35400;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.tier-conditions p.note {
    margin: 0;
}

.button.center {
    display: block;
    margin: 0 auto;
    text-align: center;
}

.button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 0.8em 1.4em;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: #0056b3;
    text-decoration: none;
}

.button[aria-disabled="true"] {
    filter: grayscale();
    pointer-events: none;
    cursor: default;
}

.accordion-content {
    overflow: hidden;
    height: 0;
    transition: height 0.6s ease;
}

.accordion-wrapper {
    margin-bottom: 1em;
}

.accordion-toggle {
    display: inline-block;
    margin-bottom: 0.5em;
    font-weight: bold;
    cursor: pointer;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
}

.break, .sample th {
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.datetime {
    white-space: nowrap;
}

.sample table {
    width: 100%;
    border-collapse: collapse;
}

.sample table, .sample th, .sample td {
    border: 1px solid #ddd;
}

.sample th {
    text-align: center;
}

.sample td {
    text-align: right;
}

.sample td span {
    display: inline-block;
    width: 2.4em;
}
