.loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #1e3a5f 0%, #2d4a70 50%, #1e3a5f 100%);
z-index: 9999;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: opacity 1s ease, visibility 1s ease;
overflow: hidden;
}

/* 和紙テクスチャ風の背景 */
.loading-screen::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: 
    repeating-linear-gradient(
    90deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(255, 255, 255, 0.03) 4px
    ),
    repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(255, 255, 255, 0.03) 4px
    );
pointer-events: none;
}

/* 波紋エフェクト */
.loading-screen::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, transparent 0%, rgba(255, 255, 255, 0.1) 40%, transparent 70%);
transform: translate(-50%, -50%);
animation: ripple 4s ease-out infinite;
}

@keyframes ripple {
0% {
    width: 0;
    height: 0;
    opacity: 1;
}
100% {
    width: 200%;
    height: 200%;
    opacity: 0;
}
}

.loading-screen.hidden {
opacity: 0;
visibility: hidden;
pointer-events: none;
}

/* 書道風メインメッセージ */
.loading-message {
position: relative;
z-index: 1;
text-align: center;
margin-bottom: 60px;
}

.loading-kanji {
font-family: 'Noto Serif JP', serif;
font-size: clamp(60px, 8vw, 100px);
font-weight: 900;
color: #ffffff;
letter-spacing: 0.2em;
margin-bottom: 16px;
opacity: 0;
animation: brushStroke 2s ease forwards;
position: relative;
font-family: 'Noto Sans JP', 'Yu Gothic', 'YuGothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Kaku Gothic Pro', 'MS PGothic', sans-serif;
}

.loading-kanji span {
display: inline-block;
opacity: 0;
transform: translateY(20px);
animation: kanjiAppear 0.8s ease forwards;
}

.loading-kanji span:nth-child(1) { animation-delay: 0.1s; }
.loading-kanji span:nth-child(2) { animation-delay: 0.2s; }
.loading-kanji span:nth-child(3) { animation-delay: 0.3s; }
.loading-kanji span:nth-child(4) { animation-delay: 0.4s; }
.loading-kanji span:nth-child(5) { animation-delay: 0.5s; }
.loading-kanji span:nth-child(6) { animation-delay: 0.6s; }
.loading-kanji span:nth-child(7) { animation-delay: 0.7s; }
.loading-kanji span:nth-child(8) { animation-delay: 0.8s; }
.loading-kanji span:nth-child(9) { animation-delay: 0.9s; }

@keyframes kanjiAppear {
0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
}
50% {
    transform: translateY(0) scale(1.1);
}
100% {
    opacity: 1;
    transform: translateY(0) scale(1);
}
}

.loading-subtitle {
    font-family: 'Noto Sans JP', 'Yu Gothic', 'YuGothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Kaku Gothic Pro', 'MS PGothic', sans-serif;
font-size: clamp(14px, 1.5vw, 18px);
color: rgba(255, 255, 255, 0.8);
letter-spacing: 0.3em;
opacity: 0;
animation: fadeIn 1s ease 1.5s forwards;
max-width: 500px;
margin: 0 auto;
line-height: 1.6;
}

/* 和風アニメーション - 円形紋様 */
.loading-animation {
position: relative;
width: 180px;
height: 180px;
margin: 20px auto 40px;
}

/* 外側の円 - 和紋風 */
.wa-circle {
position: absolute;
width: 100%;
height: 100%;
border: 2px solid rgba(255, 255, 255, 0.15);
border-radius: 50%;
animation: waRotate 20s linear infinite;
}

.wa-circle::before,
.wa-circle::after {
content: '';
position: absolute;
width: 20px;
height: 20px;
background: transparent;
border: 2px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
}

.wa-circle::before {
top: -10px;
left: 50%;
transform: translateX(-50%);
}

.wa-circle::after {
bottom: -10px;
left: 50%;
transform: translateX(-50%);
}

/* 内側の円 */
.inner-circle {
position: absolute;
width: 120px;
height: 120px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 50%;
animation: waRotate 15s linear reverse infinite;
}

.inner-circle::before,
.inner-circle::after {
content: '';
position: absolute;
width: 15px;
height: 15px;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 50%;
}

.inner-circle::before {
left: -7.5px;
top: 50%;
transform: translateY(-50%);
}

.inner-circle::after {
right: -7.5px;
top: 50%;
transform: translateY(-50%);
}

/* 中心の文字群 */
.center-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
width: 100px;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
}

.center-main {
font-family: 'Noto Serif JP', serif;
font-size: 32px;
font-weight: 900;
color: #ffffff;
letter-spacing: 0.1em;
position: relative;
animation: pulse 2s ease-in-out infinite;
}

.center-sub {
position: absolute;
bottom: -8px;
right: -15px;
font-family: 'Noto Serif JP', serif;
font-size: 16px;
font-weight: 700;
color: rgba(255, 255, 255, 0.9);
letter-spacing: 0.1em;
transform: rotate(-10deg);
animation: fadeInRotate 1s ease 2s forwards;
opacity: 0;
}

.center-english {
position: absolute;
top: -20px;
left: 50%;
transform: translateX(-50%);
font-family: 'Noto Sans JP', sans-serif;
font-size: 10px;
color: rgba(255, 255, 255, 0.5);
letter-spacing: 0.3em;
text-transform: uppercase;
}

/* 装飾的な線 */
.center-text::before {
content: '';
position: absolute;
bottom: 15px;
right: 5px;
width: 40px;
height: 1px;
background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.8) 100%);
transform: rotate(-30deg);
animation: lineGrow 2s ease 2.5s forwards;
transform-origin: left center;
opacity: 0;
}

@keyframes fadeInRotate {
0% {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
}
100% {
    opacity: 1;
    transform: rotate(-10deg) scale(1);
}
}

@keyframes lineGrow {
0% {
    opacity: 0;
    transform: rotate(-30deg) scaleX(0);
}
100% {
    opacity: 1;
    transform: rotate(-30deg) scaleX(1);
}
}

/* 禅言葉 */
.zen-words {
position: absolute;
font-family: 'Noto Serif JP', serif;
font-size: clamp(12px, 1.2vw, 14px);
color: rgba(255, 255, 255, 0.6);
letter-spacing: 0.2em;
}

.zen-word-1 {
top: 10%;
left: 10%;
animation: floatWords 6s ease-in-out infinite;
}

.zen-word-2 {
top: 10%;
right: 10%;
animation: floatWords 6s ease-in-out 1s infinite;
}

.zen-word-3 {
bottom: 10%;
left: 10%;
animation: floatWords 6s ease-in-out 2s infinite;
}

.zen-word-4 {
bottom: 10%;
right: 10%;
animation: floatWords 6s ease-in-out 3s infinite;
}

/* 進捗インジケーター - 墨汁風 */
.loading-progress {
width: 300px;
height: 4px;
background: rgba(255, 255, 255, 0.1);
border-radius: 2px;
overflow: hidden;
margin-top: 40px;
position: relative;
}

.loading-progress-bar {
height: 100%;
background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.8) 20%,
    #ffffff 50%,
    rgba(255, 255, 255, 0.8) 80%,
    transparent 100%
);
background-size: 200% 100%;
transform: scaleX(0);
transform-origin: left;
animation: inkFlow 3s ease-out forwards;
}

/* アニメーション定義 */
@keyframes brushStroke {
0% {
    opacity: 0;
}
100% {
    opacity: 1;
}
}

@keyframes fadeIn {
0% {
    opacity: 0;
}
100% {
    opacity: 1;
}
}

@keyframes waRotate {
0% {
    transform: rotate(0deg);
}
100% {
    transform: rotate(360deg);
}
}

@keyframes yinYangRotate {
0%, 100% {
    transform: translate(-50%, -50%) rotate(0deg);
}
50% {
    transform: translate(-50%, -50%) rotate(180deg);
}
}

@keyframes pulse {
0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
}
50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}
}

@keyframes floatWords {
0%, 100% {
    transform: translateY(0);
    opacity: 0;
}
20%, 80% {
    opacity: 0.6;
}
50% {
    transform: translateY(-10px);
    opacity: 1;
}
}

@keyframes inkFlow {
0% {
    transform: scaleX(0);
    background-position: -200% 0;
}
100% {
    transform: scaleX(1);
    background-position: 0% 0;
}
}

/* コンテンツの初期状態 */
body.loading {
overflow: hidden;
}

.content-wrapper {
opacity: 0;
transition: opacity 0.8s ease;
}

body:not(.loading) .content-wrapper {
opacity: 1;
}

/* 初期表示時のアニメーション */
body:not(.loading) .hero {
animation: heroFadeIn 1.2s ease forwards;
}

@keyframes heroFadeIn {
0% {
    opacity: 0;
    transform: scale(1.1);
}
100% {
    opacity: 1;
    transform: scale(1);
}
}

/* モバイル対応 - 東京都で改行 */
.sp-br {
    display: none;
}

@media (max-width: 768px) {
    .sp-br {
        display: block;
    }
}